ASP - buttons and text box - Asked By Nevyn Campanella on 19-Jul-14 02:43 AM

I am writing in Active X Dll with a class file and not using any script.
Is the following possible?

I have two submit buttons and one text box.  Button1 returns the user to
a page titled  'Get Hams'.  Button2 returns the user to a page titled
'RecordSave'.  And the text box is the material to be saved.  I would like
to place both buttons at the top of the page with the text box
below both button.  The following code does all this except I can't figure out
how to use a post method on the text box with directly including it in the 
form action of button2 and that would mean the button is below the text box.  Is 
there a way to place the button above the text box and somehow include the
text box in the form action of the button?

Code I have tried follows.

strControls = "<FORM ACTION=""htp.asp?Page=GetHams""  "
strControls = strControls & "METHOD=""POST""><TABLE BORDER=0 align=""left""<TR><TD>"
strControls = strControls & "<input type=""submit"" value=""Hams"" name=""B1"">"
strControls = strControls & "</TABLE></FORM>"

strControls = strControls & "<FORM ACTION=""htp.asp?Page=RecordSave""  "
strControls = strControls & "METHOD=""POST""><TABLE BORDER=0 align=""center""<TR><TD>"
strControls = strControls & "<input type=""submit"" value=""Save"" name=""B2"">"
strControls = strControls & "</TD></TR></TABLE></FORM>"
jptResponse.Write (strControls)

strControls = "<FORM METHOD=""POST""><input type=""text"" name=""T1"""
strControls = strControls & "value=""Hello"" size=""20""></FORM>"
jptResponse.Write (strControls)

You need to stop this... - Asked By Robbe Morris on 15-Jun-01 09:22 AM

...You keep referring to "not using any script".  All of your client side code to perform tasks like this require you to use script.  In most cases, that option is JavaScript because it's supported by NS and IE.

For someone who is working with VB class files, JavaScript will not be a difficult concept or language for you to master.  You'll not be able to do "anything" with HTML without knowing at least a little something about a client side script language.

Ok, enough of the rant (chuckle...).  Go through this
today.  You'll be surprised at just how easy it is.

Now, onto your question...

This does require you to use JavaScript embedded in your HTML.  Take a look at this link.  It performs a similar task to what you are trying to accomplish: