Best way to allow users to add their website url
Posted: Mon Sep 21, 2009 10:18 am
Hi,
I want to allow my users to add their website url (if they have one) to their profile on my site. Right now, I have it set up like:
<input type="text" value="http://" />
Couple of problems with this:
1) a user can delete the http:// and type away and then when it is displayed in their profile, the link will not work properly
2) if they enter their website and then go to update it, the update form also has the 'http://' at the start of the value attribute so it appears twice, like http://http://userssite.com
Is there a better way to display the http:// inside of the input box without it being editable? And some what to make certain that the user's website appears as a correct link to their website every time (http:// in front of it, obviously if they enter an incorrect website that is their fault).
Thank you!
I want to allow my users to add their website url (if they have one) to their profile on my site. Right now, I have it set up like:
<input type="text" value="http://" />
Couple of problems with this:
1) a user can delete the http:// and type away and then when it is displayed in their profile, the link will not work properly
2) if they enter their website and then go to update it, the update form also has the 'http://' at the start of the value attribute so it appears twice, like http://http://userssite.com
Is there a better way to display the http:// inside of the input box without it being editable? And some what to make certain that the user's website appears as a correct link to their website every time (http:// in front of it, obviously if they enter an incorrect website that is their fault).
Thank you!