Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies





5:44 pm on Jul 27, 2008 (gmt 0)

10+ Year Member

Something strange is happening with my form. When viewing the page Iwas expecting the link to be set to '#' but for some reason the url is now being prefixed with the page's own url.

<form name="myform" method="post" action="/index.php">
<input type="hidden" name="freq" value="">
<a class="green" href="#" onClick="document.myform.freq.value='abc';submitform()">click here</a>
<a class="green" href="#" onClick="document.myform.freq.value='def';submitform()">click here</a>
<input name="checkbox" value="ticked" type="checkbox">
<script language="JavaScript">
function submitform()

Can anyone help?

Cheers, Pete


8:42 pm on Jul 27, 2008 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Your form's submit action is "/index.php"
Your links are submitting the form. It doesn't matter what the href value is of the link because you're going to be redirected to "/index.php" no matter what.


9:21 pm on Jul 27, 2008 (gmt 0)

10+ Year Member

Ah gotcha. Sorry for that, managed to confuse myself.

Cheers, Pete


Featured Threads

Hot Threads This Week

Hot Threads This Month