Using this code:
$("form")
will find all the <form>
elements in your document.
Given that form
is a string containing the name of the form, what you want instead is this:
$("form[name='" + form + "']")
Looking at your supplied code, I have this suggestion. Instead of passing the form name to your function, why not just pass the form itself?
<button onclick="xmlhttpPost('blah', this.form)">
You also don't need to put javascript:
in the onclick
, onfocus
, onwhatever
properties.
nickf
2009-11-10 13:55:54