Pembar
06-24-2009, 09:37 PM
<RESOLVED>
Hey guys,
I'm trying to use javascript to submit a form. I was wondering whether this was possible.
<html>
<head>
<script language='JavaScript'>
function submitURL(url) {
document.mForm.url.value = url;
document.mForm.submit();
}</script>
<form action="test12.php" method="post" name = "mForm" id = 'mIDForm'>
URL: <input type="text" name="url" />
</form> <P>
<A HREF=""
onClick="submitURL('http://www.google.com')";>Google</A>
</body>
</html>
Clicking on the link puts the correct URL in the input field, but then the page refreshes and nothing gets sent to test12.php.
Anyone have any clue?
Thanks much.
<RESOLVED>
Thanks a lot
Hey guys,
I'm trying to use javascript to submit a form. I was wondering whether this was possible.
<html>
<head>
<script language='JavaScript'>
function submitURL(url) {
document.mForm.url.value = url;
document.mForm.submit();
}</script>
<form action="test12.php" method="post" name = "mForm" id = 'mIDForm'>
URL: <input type="text" name="url" />
</form> <P>
<A HREF=""
onClick="submitURL('http://www.google.com')";>Google</A>
</body>
</html>
Clicking on the link puts the correct URL in the input field, but then the page refreshes and nothing gets sent to test12.php.
Anyone have any clue?
Thanks much.
<RESOLVED>
Thanks a lot