i've asked this before but didn't get much response, so i'll try again

i have my comments setup so that non-registered users can post, with the option of entering their name, emial and homepage details

the problem for me is the homepage field. If a user just types www.homepage.com, they get an error page that warns that http:// is required, but at this stage the page is completely broken and they have to click back

obvisouly, this is not very user-friendly

My solution would be to have http:// already entered in the hompage field, so the user can see it and just add www.homepage.com to the field

I have looked through the comment.modle, but to be honest i don't know what i'm doing in there;)

can anyone help?

david
www.justride.co.uk

Comments

tangent’s picture

Look in the theme_comment_form() function and find all the instances of the line below.

$form .= form_textfield(t('Homepage'), 'homepage', $edit['homepage'], 20, 40);

What you want to change is the $edit['homepage'] part. Something like the following *should* work (i.e. I haven't tested it).

$form .= form_textfield(t('Homepage'), 'homepage', ($edit['homepage'])?$edit['homepage']:'http://', 20, 40);
lazydave21’s picture

tangent, you are a genius, thank you very much:)

it works perfectly- i've wanted this functionality for ages, this should be in the comment.module by default

thanks again

tdave00’s picture

Can we just remove that line if we don't want to make the user fill that in? Don't wanna remove it if it will break something somewhere else.