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!

Button vs Image form launching.

Status
Not open for further replies.

rockinhorse

Programmer
Oct 21, 2005
14
US
I am using an image to call an asp file with the "<a href" function. The file that is called does not read the text fields from the form at all. If I use a standard button object and vbscript (see below) it works.

<form name="frmLogin" method="post" action="submit">
<script language="vbscript">
Sub ProcessLogin
frmLogin.action = "/loginpost.asp"
frmLogin.submit()
End Sub
</script>

If I use an image and call the same file (see below)
it failes to read the texte fields for username and password. (See below).

Sub HyperImage(sReference,sImage,lBorder,lWidth,lHeight,sTag)
Dim sPathAndImage

sPathAndImage = Session("WebImagePath") & sImage

Response.Write("<a href='" & sReference & "'><img src='" & sPathAndImage & "' border=" & lBorder & " width=" & lWidth & " height=" & lHeight & " alt='" & sTag & "'></a>")
End Sub

This function works with all other uses except for this one.

Can anyone help?
 
<a href=... is just a hyperlink, it doesn't pass any form data.

If you want to use an image instead of the standard form buttons you must reference the image as a form element like this:

<input name="imageField" type="image" src="DB_images/size1/GIWOKEB18L1626.jpg" width="150" height="100" border="0">



BDC.
 
The title of the thread says "form launching" .... are you referring to submitting a form?
 
I am using a loginpost.asp form to read the two fields, so actually no data gets passed by virtue of the button. I guess it is a submit function.
 

as per BDC2's post - or add an onclick event that calls a function that will submit your form.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top