<td Onclick= how to submit a form?

i have to submit a form onlick on text , for example :<br />
<br />
<td onlick=somethingThatHelpMeSolveThis(submit) > thanks</td><!--content-->you hav to write a javascript function that carries out the submitting<br />
eg. in the form HTML: <br />
<A HREF=http://www.webdeveloper.com/forum/archive/index.php/"http://page to go onto after click" onClick="submitForm('formName)">SEND</A><br />
<br />
in the Javascript <br />
function submitForm(sub) {<br />
document.forms[sub].submit();<br />
}<br />
<br />
<br />
:)<!--content-->You have to allow for the one in ten users that do not use JavaScript (<!-- m --><a class="postlink" href="http://www.thecounter.com/stats/2002/November/javas.php">http://www.thecounter.com/stats/2002/November/javas.php</a><!-- m -->). Thus:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"<br />
"http://www.w3.org/TR/html4/strict.dtd"><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<meta name="Content-Script-Type" content="text/javascript"><br />
<title>Form Exampla</title><br />
<form action="someScript.pl" name="formName"><br />
<div><br />
<script type="text/javascript"><br />
<!--<br />
document.write('<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">Submit</a>');<br />
document.links[document.links.length-1].onclick = function () {<br />
document.formName.submit();<br />
return false;<br />
}<br />
// --><br />
</script><br />
<noscript><input type="submit"></noscript><br />
</div><br />
</form><!--content-->Thanks , really helped me out...<!--content-->
 
Back
Top