<script type="text/javascript">
jQuery.validator.addMethod("steam_id", function(value, element) {
return this.optional(element) || /^STEAM_0:(0|1):[0-9]{1}[0-9]{0,8}$/.test(value);
});
jQuery.validator.addMethod("nome", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9._ -]{4,16}$/.test(value);
});
$().ready(function() {
var validator = $("#form3").bind("invalid-form.validate", function() {
$("#summary").html("O formulário contém " + validator.numberOfInvalids() + " erros.");
}).validate({
debug: true,
errorElement: "em",
errorContainer: $("#warning, #summary"),
errorPlacement: function(error, element) {
error.appendTo(element.parent("td").next("td"));
},
success: function(label) {
label.text("").addClass("success");
},
rules: {
steamid: {
required: true,
steam_id: true
},
username: {
required: true,
nome: true
},
nickname: {
required: true,
nome: true
},
}
});
});
</script>
Well, my question is, how do I submit this form to php. I want to insert a thing in a databse and I have a phpscript for that, but with this validation I can't do that.
Can you tell me how submit using jquery?