Hi,
I am using the placeholder input parameter in my form. However, if a user does not fill out the field, the placeholder is returned. How do I get the field to return a blank/empty value if a user does not fill out that field?
Any help is appreciated.
I am using the placeholder input parameter in my form. However, if a user does not fill out the field, the placeholder is returned. How do I get the field to return a blank/empty value if a user does not fill out that field?
Any help is appreciated.
Hi kko,
Check for the placeholder value after submission and delete it if it is found.
Bob
Check for the placeholder value after submission and delete it if it is found.
Bob
Hi Bob,
Can you post the php code for doing something like that?
I know essentially it's something like: if [fieldname] == [placeholder] then return ''
I don't know php well enough to write it all out correctly. 😟
Can you post the php code for doing something like that?
I know essentially it's something like: if [fieldname] == [placeholder] then return ''
I don't know php well enough to write it all out correctly. 😟
Hi kko,
In the OnSubmit Before box
Bob
In the OnSubmit Before box
<?php
$input_name = JRequest::getVar('input_string', '', 'post');
if ( $input_name == 'place_holder' ) {
$input_name = '';
}
JRequest::setVar('input_name', $input_name);
?>
There are other ways but this should do it.Bob
Bob,
Thank you so much for the help. The code does what I want it to do.
Now the issue is that validation does not seem to work with input placeholders. :?
Thank you so much for the help. The code does what I want it to do.
Now the issue is that validation does not seem to work with input placeholders. :?
Any ideas for a solution/workaround to have validation work with input placeholders?
Hi bob
I bought ChronoForms v4 placeholder labels but it doesnt work with date/time picker, with 2 or more forms and pass the validation for Alpha.
How can i fix this errors
I bought ChronoForms v4 placeholder labels but it doesnt work with date/time picker, with 2 or more forms and pass the validation for Alpha.
How can i fix this errors
Hi colemjosel,
I don't think I've tested with a date-picker. I'll take a look at that. The Alpha validation should be OK. I don't know about two forms on the page; I think that should work provided that the input IDs are all unique.
Please post a link to the form so I can take a quick look.
Bob
I don't think I've tested with a date-picker. I'll take a look at that. The Alpha validation should be OK. I don't know about two forms on the page; I think that should work provided that the input IDs are all unique.
Please post a link to the form so I can take a quick look.
Bob
Hi colemjosel,
I'm not clear why the Alpha validation isn't working. It may be because you are not loading the MooTools More library on the page.
The Date & Time Picker won't work because the standard datepicker creates a copy of the input and moves the original one off the page so the Placeholder labels tries to update the hidden copy. You could try switching to the MooTools datepicker which works differently and may accept the labels.
Bob
I'm not clear why the Alpha validation isn't working. It may be because you are not loading the MooTools More library on the page.
The Date & Time Picker won't work because the standard datepicker creates a copy of the input and moves the original one off the page so the Placeholder labels tries to update the hidden copy. You could try switching to the MooTools datepicker which works differently and may accept the labels.
Bob
This topic is locked and no more replies can be posted.