Rectangle 27 0

It looks like the jQuery validate plugin requires your inputs to have name attributes in order to function properly.

<form id="braintree-payment-form">
    <input type="text" name="first_name" id="first_name" />
    <br/><br/>
    <input type="text" name="last_name" id="last_name" />
    <br/><br/>
    <input type="text" name="number" id="number" data-encrypted-name="number" />
    <br/><br/>
    <input type="text" name="cvv" id="cvv" data-encrypted-name="cvv" />
    <br/><br/>
    <input type="submit" />
</form>

However, the encryption methods inside of braintree.js will remove the name attribute of inputs that it encrypts to prevent you from submitting raw credit card data through to your server. This may cause issues if you encrypt the form, but input validation fails. Typically, we'd recommend you perform the encryption as the last step of the form submission process.

My validation works without the name attributes.

@Shina validation without name attributes not working for me. I want validation with c#.net

@KulbirSingh ... can you share the html code?

@KulbirSingh ... do you have attribute: required="required" ?

@KulbirSingh ... I think I had that problem. Do this: <input type="number" name="cvv" size="5" class="form-control input-lg cvvRequired" autocomplete="off" placeholder="024" required> and then do something like this in your JS if($(this).valid()) { $('.cvvRequired').removeAttr('type').attr('data-encrypted-name', 'cvv');" once the form as been submitted.

validation - jQuery validate plugin with data-encrypted-name attribute...

jquery validation jquery-validate braintree
Rectangle 27 0

It looks like the jQuery validate plugin requires your inputs to have name attributes in order to function properly.

<form id="braintree-payment-form">
    <input type="text" name="first_name" id="first_name" />
    <br/><br/>
    <input type="text" name="last_name" id="last_name" />
    <br/><br/>
    <input type="text" name="number" id="number" data-encrypted-name="number" />
    <br/><br/>
    <input type="text" name="cvv" id="cvv" data-encrypted-name="cvv" />
    <br/><br/>
    <input type="submit" />
</form>

However, the encryption methods inside of braintree.js will remove the name attribute of inputs that it encrypts to prevent you from submitting raw credit card data through to your server. This may cause issues if you encrypt the form, but input validation fails. Typically, we'd recommend you perform the encryption as the last step of the form submission process.

My validation works without the name attributes.

@Shina validation without name attributes not working for me. I want validation with c#.net

@KulbirSingh ... can you share the html code?

@KulbirSingh ... do you have attribute: required="required" ?

@KulbirSingh ... I think I had that problem. Do this: <input type="number" name="cvv" size="5" class="form-control input-lg cvvRequired" autocomplete="off" placeholder="024" required> and then do something like this in your JS if($(this).valid()) { $('.cvvRequired').removeAttr('type').attr('data-encrypted-name', 'cvv');" once the form as been submitted.

validation - jQuery validate plugin with data-encrypted-name attribute...

jquery validation jquery-validate braintree