Text box and href

Discussing Html . Code , Software , other

Moderators: egami, macek, gesf

Post Reply
User avatar
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Fri Jan 21, 2005 10:53 am

Yes, it can, but it takes a bit of JavaScript. Be aware that it won't work for users who have disabled JavaScript in their browser (there are more of these than you'd think). Anyway, basically what you need to do is add an onclick attribute to the link and in the onclick have JavaScript to submit your form. The form's action attribute must be the page which you want the form submitted to. Something like this:

Code: Select all

<form method="GET" action="Results.php" name="myForm">
  <input type="text" name="MatchUpdNo" size="2" />
  <a onclick="myForm.submit()">Click Here!</a>

Post Reply