I have an Html template with a form inside of it.
<form id="my_form" method="post" action="/register/">
<input id="cemail" name="email" size="25" class="textbox required email" style="width: 250px"> <br><br>
<input id="csubmit" type="submit" onclick="Clicked();" value="Send" />
I also have a Jquery code for test if the e-mail introduced is correct:
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script>
function Clicked() {
$("#my_form").validate().form();
value = $("#cemail").val();
alert("ufffff");
$.get("/exists/", {email: value}, function(data) {
$('#text')[0].innerHTML=data;
});
}
</script>
Until here everything is ok. My problem appears when I execute the program. Always the action="/register" is launched, and I don't want that it occurs. I would like that:
If jquery is desactivated on the client browser, execute the action that the form has. In case that jquery is activated on the client browser, just execute the "Clicked()" function and not the form's action ("/register/" --> calls django function)
Does anyone help me to do that? Is it possible?