Hi to all,
I have a problem using Internet Explorer (v.8 +) with a text box that has to be required or not depending on the value of a drop-down menu.
Text box has id = "ans_id" and drop-down menu has id = "status".
I have inserted in a "Load JS" the following code:
Everything works fine at least with Firefox and Chrome, but using Internet Explorer (as usual...) the field "ans_id" does not become required, so users are able to submit without filling the text box.
What can I try to make it working???
Thanks in advance
Alessandro
I have a problem using Internet Explorer (v.8 +) with a text box that has to be required or not depending on the value of a drop-down menu.
Text box has id = "ans_id" and drop-down menu has id = "status".
I have inserted in a "Load JS" the following code:
window.addEvent('domready', function() {
$('status').addEvent('change', function() {
if ( $('status').value == 'some-value' ) {
$('ans_id').setProperty('required', 'required');
} else {
$('ans_id').setProperty('required');
}
});
});
Everything works fine at least with Firefox and Chrome, but using Internet Explorer (as usual...) the field "ans_id" does not become required, so users are able to submit without filling the text box.
What can I try to make it working???
Thanks in advance
Alessandro
Hi GreyHead, first of all thank you very much for your help.
This is the link:
http://www.nureth15.org/index.php?option=com_chronoforms&chronoform=attendant_registration
Fields are in the "Registration Info" tab.
Regards,
Alessandro
This is the link:
http://www.nureth15.org/index.php?option=com_chronoforms&chronoform=attendant_registration
Fields are in the "Registration Info" tab.
Regards,
Alessandro
Hi Alessandro,
The 'required' attribute is a new HTML5 attribute. As far as I can see it isn't supported in IE8 or Safari and it's also not used by ChronoForms.
See the 'Field validation' entry on this test page .
Bob
The 'required' attribute is a new HTML5 attribute. As far as I can see it isn't supported in IE8 or Safari and it's also not used by ChronoForms.
See the 'Field validation' entry on this test page .
Bob
Ok, thank you very much. I solved the problem slightly changing the form logic.
I set the text box mandatory, and with the same code changed it to disabled if the value selected in the drop-down menu does not match.
In this way it works.
Thanks again.
Alessandro
I set the text box mandatory, and with the same code changed it to disabled if the value selected in the drop-down menu does not match.
In this way it works.
window.addEvent('domready', function() {
$('status').addEvent('change', function() {
if ( $('status').value == 'some-value' ) {
$('ans_id').setProperty('disabled');
} else {
$('ans_id').setProperty('disabled', 'disabled');
}
});
});
Thanks again.
Alessandro
This topic is locked and no more replies can be posted.