Hello,
My freeform tag looks like this:
{exp:freeform:form collection="Submit-Ideas" notify="[email protected]" required="" template="comments" return="thank-you"}I would like to be able to update which fields are required based on a radio button selection. Here is an example in jquery where I would like to set the email field as required:
$(document).ready(function(){
$(".radioChoice2").click(function(){
if ($('input[name=radioOption]:checked').val() == "Email" ) {
$("form[form_name=Submit-Ideas]").attr("required", "email");
}
});
});Has anyone tried anything similar or could point to what I am doing wrong. The required field does not get set
Thanks
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.