I would like to use jquery, but couldnt find a subject on that so posted this in javascript hope thats ok.
my HTML form is like this
[code=html]
<form id="10" method="post" action="">
<input type="text" name="name">
<input type="submit" name="submit" value="Submit">
</form>
[/code]
i am new to jQuery but my code is as follows....
[code=javascript]
$(function(){
var form_id = $("form").attr( "id"); // output 10
$("#submit").cl ick(function(){ // onclick submit
form_id = +1 // increment by 1
// form_id = 2
});
});
[/code]
This doesn't work as i think i need to set the id, or am i doing something completely wrong?
my HTML form is like this
[code=html]
<form id="10" method="post" action="">
<input type="text" name="name">
<input type="submit" name="submit" value="Submit">
</form>
[/code]
i am new to jQuery but my code is as follows....
[code=javascript]
$(function(){
var form_id = $("form").attr( "id"); // output 10
$("#submit").cl ick(function(){ // onclick submit
form_id = +1 // increment by 1
// form_id = 2
});
});
[/code]
This doesn't work as i think i need to set the id, or am i doing something completely wrong?
Comment