View Full Version : <RESOLVED>Why can't I submit?

06-24-2009, 10:37 PM

Hey guys,

I'm trying to use javascript to submit a form. I was wondering whether this was possible.

<script language='JavaScript'>
function submitURL(url) {
document.mForm.url.value = url;

<form action="test12.php" method="post" name = "mForm" id = 'mIDForm'>
URL: <input type="text" name="url" />
</form> <P>

<A HREF=""


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.


Thanks a lot

06-24-2009, 10:49 PM
The page "refreshes" because of the anchor tag with the empty href - that means go back to self. If you don't want to follow that link, try using a "return false;" along with the function call.

Not sure if that will work for anchors, but that's how to break the submit for a button.