I like to make a client-side validation with JavaScript. For this I'm using the jQuery Plugin Validate() watch here: http://docs.jquery.com/Plugins/Validation/Methods
By clicking on the submit Button I want to compare the ID inside the iput field with an regular expression. How can I solve this?
For now I did it like this:
<form id="checkoutFormBean" action="/view/checkout?execution=e3s1" method="POST">
<li>
<input id="id" name="id" class="fieldError required number" tabindex="12" value="" maxlength="2048" type="text">
</li>
<script type="text/javascript">
$(document).ready(function(){
$("#checkoutFormBean").validate({
id: "required",
id: {
equalTo: "/^2099[0-9]{9}$/"
}
});
});
</script>
But its not working