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

Newbie Question - input button using image instead of text

Status
Not open for further replies.

demills

Programmer
Jun 14, 2002
10
CA
The following code works fine and displays text "Layer Control" on a button.

<input name="LayerControl" Type="Submit" Value="Layer Control" >

How do you get an BMP image to display instead of the text? I tried setting the type to Image but it doesn't allow me to set a value. I need to detect if the button was pressed. Is their another way to detect if an image button was pressed?

 
The image button comes down to browser preference. Some browsers like Firefox will in fact send the value of the button in addition to a set of coordinates.
Other's like IE will only send a set of coordinates of where the button was clicked.

You'll need to check for the existence of those coordinates as those are always sent.

The names are nameofsubmitbutton[red]_x[/red] or nameofsubmitbutton[red]_y[/red] so in your case you would need to check for the existence of LayerControl_x or LayerControl_Y.

Additionally you should not be using a BMP file for a website. JPG, GIF, or PNG would be more appropriate.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks Vacunita thats what I was looking for. I'll give it a try.

The images are actually GIF's. I typed the wrong extension.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top