Text box and href

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » 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>
</form>

Return to “HTML Basics”

Who is online

Users browsing this forum: No registered users and 1 guest

cron