Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies



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

Full Member

10+ Year Member

joined:Mar 16, 2004
posts: 283
votes: 0

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 July 27, 2008 (gmt 0)

Senior Member from US 

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

joined:Oct 17, 2005
votes: 20

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 July 27, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Mar 16, 2004
votes: 0

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

Cheers, Pete


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members