[jQuery] newbie question accessing form
I have a simple form with 4 form fields, they are "m, name, value,
submit"
<form id="new_form">
<input type="hidden" name="m" value="mmm">
<table>
<tr><td>name</td><td><input type="text" name="name"></td></tr>
<tr><td>value</td><td><input type="text" name="value"></td></tr>
<tr> </td><td><input type="submit" name="submit"
value="create">
<input type="submit" name="submit"
value="cancel"></td></tr>
</table>
</form>
i need to do a couple of things,
[1] access the values of all 4 fields
i may do some formatting of "name" or "value".
i need to examine whether submit is "create" or "cancel".
[2] enable and disable submit buttons "create" and "cancel".
$("#new_form").submit(function()
{
// alert(this.m.value);
// alert(this.cmd.value);
// alert(this.name.value);
// alert(this.value.value);
alert(this.submit.value); // <-- doesn't work
return false;
});
$(???).attr("disabled","disabled");
$(???).removeAttr("disabled");