I am looking to do some validation inside my jquery script for numbers and email. I am unsure how i can add this to my current script? This is what i have so far:
<script>
$("#quote-me").click(function(e){
e.preventDefault();
var pnum = $("#partnum").val();
var quantity = $("#quant").val();
var location = $("#locate").val();
var custemail = $("#email").val();
var r = $.ajax({
url : "/support/quote/",
dataType : "JSON",
type : "POST",
data : {
action : "true",
pnum : pnum,
quantity : quantity,
location : location,
custemail : custemail
}
});
r.done(function(response){
if(response.confirm !== undefined) {
$("#confirmmessage").html(response.confirm);
$("#confirmmessage").show();
$("#speedquoteform input[type='text']").val("");
}
});
});
$("#speedquoteform input[type='text']").focusin(function() {
if($("#confirmmessage").is(":visible")) {
$("#confirmmessage").hide();
}
});
</script>