I am very, very new at JQuery and only mildly competent with javascript, so
please be patient.

I have a form that at present validates by js first and then the js submits
the form.  Of course, the form doesn't work at all if js is disabled.  I
want to change it so that the buttons are setup as submit buttons, but
updated by jquery to ordinary buttons with onclick events.  I'm struggling
at bit with the syntax.

Here is my code so far:

<html>
<head>
<script type="text/javascript"
  src="jquery.js"></script>
<script type="text/javascript">
$(document).onready(
        $(document.getElementsById("sendmail"))
        .set("onclick", "validate()").set("type", "button")

);

function validate() {
        alert ('validated');
}
</script>
</head>
<body>
<form>
<input 
type="submit" name="sendmail" id="sendmail"
value="SEND" class="button" />
</form>
</body>
</html>
-- 
View this message in context: 
http://www.nabble.com/Simple-form-setup-tf2187171.html#a6050642
Sent from the JQuery forum at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to