• 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: Label as default value not working

Label as default value not working 14 years 7 months ago #11618

I am using RSform Pro on joomla 1.5.21

I 've read the guide about Label as default value

http://www.rsjoomla.com/customer-support/documentations/34-custom-scripting/378-label-as-default-value.html

but it is not clear to me

Where should I put this code and how to edit it:

onfocus="if (this.value=='First Name*' ) this.value='';"
onblur="if (this.value=='' ) this.value='First Name*';"

Thank you
Last Edit: 14 years 7 months ago by lucadales. Reason: disable smileys
The administrator has disabled public write access.

Re:Label as default value not working 14 years 7 months ago #11623

PLease help
The administrator has disabled public write access.

Re:Label as default value not working 13 years 11 months ago #13717

The code lines:

onfocus="if (this.value=='First Name') this.value='';"
onblur="if (this.value=='') this.value='First Name';"

should be added in the Additional Attributes area of the field, while you should also add the caption of the field in it's Default Value.

*Note: ('First Name') is variable based on the caption you are using.

Regards!
The administrator has disabled public write access.

Re:Label as default value not working 13 years 11 months ago #13764

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 745
  • Thank you received: 66
Hello,

The two lines of script should be placed in the "Additional attributes" property of the field, as InternalWealth mentioned. The "First Name" value refers to the actual value that is added in the field when the page is loaded, you can control it from the "Default value" property of your field.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re: Label as default value not working 13 years 5 days ago #17303

  • scott26
  • scott26's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I am having a problem with this. I have entered the code, field names, etc. but when I load the page the input fields are blank - UNLESS - I move the cursor into them, select, and enter nothing, then they populate correctly.

Browser
Firefox or Chrome
Code
{error}
<table border="0">
	<tr class="rsform-block rsform-block-name">
		<td>{Name:body}<div class="formClr"></div>{Name:validation}</td>
		<td>{Name:description}</td>
	</tr>
	<tr class="rsform-block rsform-block-phone-number">
		<td>{Phone Number:body}<div class="formClr"></div>{Phone Number:validation}</td>
		<td>{Phone Number:description}</td>
	</tr>
	<tr class="rsform-block rsform-block-email-address">
		<td>{Email Address:body}<div class="formClr"></div>{Email Address:validation}</td>
		<td>{Email Address:description}</td>
	</tr>
	<tr class="rsform-block rsform-block-message">
		<td>{Message:body}<div class="formClr"></div>{Message:validation}</td>
		<td>{Message:description}</td>
	</tr>
	<tr class="rsform-block rsform-block-submit">
		<td>{Submit:body}<div class="formClr"></div>{Submit:validation}</td>
		<td>{Submit:description}</td>
	</tr>
</table>
Example Field
Name: Name
Caption: Name
Attributes:
onfocus="if (this.value=='Name*') this.value='';"
onblur="if (this.value=='') this.value='Name*';"
The administrator has disabled public write access.

Re: Label as default value not working 13 years 5 days ago #17314

  • deziner76hd
  • deziner76hd's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
Those go in the additional attributes
Where there's a will there's a way
The administrator has disabled public write access.

Re: Label as default value not working 12 years 10 months ago #18187

  • sandstorm871
  • sandstorm871's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Hi Im getting the same issues as Scott26.

I have added this code to Attributes> Additional Attributes.
onfocus="if (this.value=='Full Name') this.value='';"
onblur="if (this.value=='') this.value='Full Name';"

Nothing shows in the field unless I hover over it and click the text box.

Also I have tried adding "Full Name" to default value but this then keeps the default value there, even if the user doesn't add anything

Please help
The administrator has disabled public write access.

Re: Label as default value not working 12 years 9 months ago #18239

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Since the script is working after you click into the field and out of the field once, that means the script is working properly and the issue lies somewhere else. Please try setting the value you are comparing in the script in the "Default Value" property of your field as well and test the script one more time.
For example:

onfocus="if (this.value=='First Name*') this.value='';"
onblur="if (this.value=='') this.value='First Name*';"

Please try setting the "Default value" property of your field to "First Name*", then test the script one more time.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: xoomserve

:) Label as default value not working 11 years 11 months ago #23315

Hello adrianp,

I have the same issue, and when I try your advise its work fine.
So I would like to confirm your fix to let other know it will fix them matter.

Thank you for this great stable solution.

XOOMSERVE
The administrator has disabled public write access.

Label as default value not working 11 years 11 months ago #23348

Just as a reminder take out the "*" in the above script or add it to your Default Value.
Last Edit: 11 years 11 months ago by hayabusa hitsugaya.
The administrator has disabled public write access.

Label as default value not working 11 years 11 months ago #23528

  • tobypsl
  • tobypsl's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 62
  • Thank you received: 1
Just to add something that confused me initially.

The script works fine with asterisks as they are in the script - for 1 field on the form.
ie. The asterisk is in the script - not the default value. It will magically appear in the default value when the form loads.

But when you use the script in more than 1 field it will only work on the first. ie. the asterisk doesn't appear in the default value when the form loads. Unless the asterisk is added to the 'default value' AND left in the script.
The administrator has disabled public write access.
  • 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!