• 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 - bypasses required field

Label as default value - bypasses required field 10 years 11 months ago #27646

Hi,
I've successfully got this working in the additional attributes area:
www.rsjoomla.com/support/documentation/v...s-default-value.html

So that I have the default value placed inside the form field as a label to tighten the spacing.

However, with text in each box, it makes it possible for forms to be submitted with just that text in making the required field rule not work the way it should.

Any ideas of how to get this working the way that I need to ?

Thanks
Darren.
The administrator has disabled public write access.

Label as default value - bypasses required field 10 years 11 months ago #27651

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
You can try using the $invalid variable. Basically you will make a script to check if the field i.e. Name has the value of the text you used for the label. If that value is found it will not validate.

Example of script below :
if($_POST['form']['Name'] == 'Please insert name')
  $invalid[] = RSFormProHelper::getComponentId("Name");

more information in this article: PHP scripts
My help is not official customer support. To receive your support, submit a ticket by clicking here
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!