tags:

views:

235

answers:

1

How would I add a prefix to a text field? For example, I have a field called "website" which is currently displayed like this:

website: ____________

Where _ is the input field. With the module "field markup" i can add prefix and suffixes but they apppear AFTER the _ or before the website part. I need to end up with:

website: http:// ____________

Any ideas how to do this?

A: 

You can use hook_form_alter to modify a textfield's #field_prefix (as opposed to #prefix). You could also use the CCK Link module to provide a proper URL field, that'll add http:// as necessary and validate the URL's format.

ceejayoz
I do use CCK link, but it does not add http to the front? Maybe I should upgrade the version I am using.
RD
I dont think LINK CCk offers this. Going to try your other suggestion now.
RD
The Link CCK field doesn't put http:// in front, but it does make sure the user entered a valid URL.
ceejayoz

related questions