Forum Moderators: open
onsubmit="return fnc(this);"
Your JavaScript:
function fnc(form){
form.imgname.src='images/a.gif';
return true;
}
The onsubmit handler returns the value true to ensure that the form actually gets sent (this may be strictly unnecessary, but it's as well to cover all eventualities). The this keyword refers to the form; it saves you having to type document.formname every time (you missed out the "document" in your code) and means you can use the same function with different forms.
I haven't tested it, though; it assumes that the form button does actually have an src property -- I'm not certain that's the case. If not, try
document.imgname.src
and see if that works.