• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How do I make the default value disappear?

How do I make the default value disappear? 15 years 5 months ago #8996

  • nate.hunter
  • nate.hunter's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 3
Ok, so you're a newbie...I'm right there with you, but I'm learning... So you're creating your form and you need to help communicate something about the content of a field but who wants to delete the default value before they type. Use a combination of default value and additional attributes...

So we want the user to fill in a field called Make and a good example is Ford. So set the default value to the following

Default value field = "Example: Ford" (don't need the quotes)

Then put the following code in the Additional Attributes field =
onfocus="if(this.value=='Example: Ford')this.value='';"
onblur="if(this.value=='')this.value='Example: Ford';"

What i've recently learned is that the additional attributes field is basically the input tag contents. WHATEVER you put in here gets put into the input tag for this field.

So...if you do the above you end up with an input tag like this...
<input name="make" type="text" value="Example: Ford"
onfocus="if(this.value=='Example: Ford')this.value='';" 
onblur="if(this.value=='')this.value='Example: Ford';">

It took me a long time to figure out that the additional attributes field did this...now that I know that - it opens up a whole new vista of capability and functionality...

If you want to see this in action www.nomoredeductible.com/drc

Enjoy!
Last Edit: 15 years 5 months ago by nate.hunter.
The administrator has disabled public write access.
The following user(s) said Thank You: anthony.burge, simon.brandon55, jessicamol
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!