validate required radio button
Posted: 2015-05-01 02:49
have a required field that uses radio buttons with no default. If no radio button is selected I expected a modal dialog to inform the user they needed to select an option and stop form submission. Instead the form submits to a page with a warning that the field cannot be blank and a "Back" button. Of course the back button doesn't work either because it is asking if you want to resubmit the form.
Looking at the common_js.php file I see the validateData function there, but it is only looking to see if the field is blank, not looking for a "checked" button. I can get so far with javascript but not sure about inserting the right code in the common_js file as it will be overwritten with future changes.
Should the validateData function generated by AppGini be different if the field type is "radio"? Or do I have to create a custom validation in the hooks folder if I want to use radio buttons for required fields?
Thanks!
Looking at the common_js.php file I see the validateData function there, but it is only looking to see if the field is blank, not looking for a "checked" button. I can get so far with javascript but not sure about inserting the right code in the common_js file as it will be overwritten with future changes.
Should the validateData function generated by AppGini be different if the field type is "radio"? Or do I have to create a custom validation in the hooks folder if I want to use radio buttons for required fields?
Thanks!