Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit a for using text, not a button

Status
Not open for further replies.

JoeM6

Programmer
Aug 5, 2000
53
US
How do i submit a form using text instead of using a button. I know how to do a button and a graphic, but not using text, can someone help?


JoeM6
JPMJR11@aol.com
 
Joe,

<SCRIPT LANGUAGE=javascript>
<!--
function doSubmit(){
document.form1.submit();
}
//-->
</SCRIPT>
</head>
<body topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>
<form name=&quot;form1&quot; action=&quot;junk.asp&quot;>
<INPUT type=&quot;text&quot; id=text1 name=text1>
<a href=&quot;javascript:doSubmit();&quot; >Submit </a>
</form>

Hope this helps
-pete
 
I agree with palbano. There is no good HTML method to do it, you have to use JavaScript. The best HTML way to do it would be to use a link to the target with your info on the query string.

eg.
Code:
<a href=&quot;target.file?option1=value1&option2=value2&etc&quot;>link1</a>
<a href=&quot;target.file?option1=value3&option2=value4&etc&quot;>link2</a>
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top