Hi,
I have a form auto generated form field that posts as prodSku[]
Validate This doesn't seem to like this much.
Uncaught TypeError: Cannot read property 'form' of undefined
/*<![CDATA[*/jQuery(function($){var $form_AddProductForm = $("#AddProductForm");$form_AddProductForm.validate({ignore:'.ignore'});var fm={};fm['prodSku[]'] = $(":input[name='prodSku[]']",$form_AddProductForm);fm['prodSku[]'].rules("add",{required:true,messages:{required:"Product SKU required, please select a product"}});});/*]]>*/</script>
This is in a coldBox application. my xml is as such...
<?xml version="1.0" encoding="UTF-8"?>
<validateThis xsi:noNamespaceSchemaLocation="validateThis.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<objectProperties>
<property name="prodSku[]">
<rule type="required" failureMessage="Product SKU required, please select a product" />
</property>
</objectProperties>
</validateThis>
if I change prodSku[] to prodSku the remaining jquery objects load on the page but of course I won't be able to validate this form field.
is there something I can update in validateThis to allow brackets in a formfield or should I look into this autogenerated field. it's an autosugest function that adds X amount of products which turns the field from prodSku into prodSku[] before posting.
this field is used in other froms so I don't want to mess with it unless I need to, but this one area it's being used requires validation so I need to come up with something to get around the problem.
Thank you to the group for your assistance.
regards,
Casey