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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have written some simple ASP code 1

Status
Not open for further replies.

sfenx

Programmer
Feb 23, 2001
81
BE
I have written some simple ASP code (see below) with 2 submit buttons. I would like the submit buttons to be 2 images. The problem is that I can't use the 'value' parameter with the <Input type=&quot;image&quot;>-tag (it returns x and y coordinates).

Code:
<BODY>
    <% lang = request.form(&quot;language&quot;) %>
    <% if lang = &quot;2&quot; then %>
        ENGLISH
    <% else %>
        DUTCH
    <% end if %>

    <FORM action=&quot;[URL unfurl="true"]http://mysite.asp&quot;[/URL] method=&quot;post&quot;>
    <INPUT name=&quot;language&quot; type=&quot;submit&quot; src=&quot;/jpg/NLbutton.jpg&quot; value=&quot;1&quot;>
    <INPUT name=&quot;language&quot; type=&quot;submit&quot; src=&quot;/jpg/ENbutton.jpg&quot; value=&quot;2&quot;>
    </form>
</body>[\code]

I could use different names for each button, but that would take me a lot longer writing supplemental code. I try to prevent 'hard coding' in my source, so I use a lot of parameters linked to databases (in this case the &quot;value&quot;).
I already tryed [code]<input type=&quot;submit&quot; style=&quot;background-Image:url(/jpg/ENbutton.jpg)&quot; value=&quot;2&quot;>
[\code] but this works only in IE4 and not in NN4.

Any help would be great!
Sven

PS: also posted in HTML and CSS forum
 
Nick, that's what I was looking for! Is there also a way to hide the variable in the URL?

PS: sorry about the subject! (forgotten) :)
 
Heres another way to do it so no variables show up in the querystring, using two forms:


<form action=&quot;=&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;language&quot; value=&quot;1&quot;>
<input type=&quot;image&quot; name=&quot;imagefield&quot; src=&quot;/jpg/NLbutton.jpg&quot;>
</form>

<form action=&quot;=&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;language&quot; value=&quot;2&quot;>
<input type=&quot;image&quot; name=&quot;imagefield&quot; src=&quot;/jpg/ENbutton.jpg&quot;>
</form>

This should do the trick Nick (Web Designer)


nick@retrographics.co.uk
 
HowardMarks ,
using hidden form fields will still show the values in the URL
[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Thanks, Nick. Sjvaree (programmer) just gave me a shorter version of your solution : thanx guys, you realy helped me out here !

Code:
<% lang = request.form(&quot;language&quot;) %>
<% if lang = &quot;2&quot; then %>
  ENGLISH
<% else %>
  DUTCH
<% end if %>

<FORM name=&quot;Form1&quot; action=&quot;[URL unfurl="true"]http://mysite.asp&quot;;[/URL] method=&quot;post&quot;>
<input type=hidden name=&quot;Language&quot;>
<input type=image src=&quot;/jpg/NLButton.jpg&quot; onclick=&quot;document.Form1.Language.value='1'&quot;>
<input type=image src=&quot;/jpg/ENButton.jpg&quot; onclick=&quot;document.Form1.Language.value='2'&quot;>
</form>[\code]
 
apologies I was still going off this post

<% lang = request.QueryString(&quot;language&quot;) %>


[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
in saying that remember to change it to
<% lang = request.form(&quot;language&quot;) %>

[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top