Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2004, 03:56 PM
Authorized User
 
Join Date: Jan 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple Submit Buttons using an image

Hello,

I am using icons in place of submit buttons; the user will click on the icon to find more information on a company. I am using a SQL Database and the If not command to list the companies from the database and their corresponding company id. The following script works, but I want to use an image instead of the submit button.


If Not rs.EOF Then

'some code here before the problem script

Response.Write "<td><form name='More Info"& strCompanyNumber & "' action='moreinfo.asp' method='get'>"
Response.Write "<input name='CompanyInfo"& strCompanyNumber & "' value='" & strCompany & "' type='submit' src='/images/more_info.jpg' alt='Company Information'>"

'some code here after the problem script
rs.MoveNext
End If
Next

Produces the desired result: http://www.mycompany.com/Directory/C...anyInfo1=50888

However, I want to use an image here instead using a button with the company ID written on it (Something like the following, except it doesn’t work.):


If Not rs.EOF Then

'some code here before the problem script

Response.Write "<td><form name='More Info"& strCompanyNumber & "' action='moreinfo.asp' method='get'>"
Response.Write "<input name='CompanyInfo"& strCompanyNumber & "' value='" & strCompany & "' type='image' src='/images/more_info.jpg' alt='Company Information'>"

'some code here after the problem script
rs.MoveNext
End If
Next

When I use the type='image' and the get command, I receive the following URL:

http://www.mycompany.com/Directory/C...panyInfo1.y=20

How can I get the results from the first script, using an image instead of a submit button?

Thank you for your help.



 
Old April 22nd, 2004, 04:11 PM
Authorized User
 
Join Date: Jan 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found a work around, avoiding forms all together:

Response.Write "<a href='moreinfo.asp" & "?CompanyInfo=" & strCompany & "'> " & _
"<img src='/images/more_info.jpg' alt='Company Information' width='22' height='22' border='0'></a>"

I am not sure if I will run into problems later or not, but thank you for your help.








Similar Threads
Thread Thread Starter Forum Replies Last Post
2 Submit Buttons ... HOW? Benno Dreamweaver (all versions) 1 November 23rd, 2004 12:14 PM
multiple Image submit buttons set default to last sam HTML Code Clinic 2 June 30th, 2004 02:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.