image button

Results 1 to 2 of 2

Thread: image button

  1. #1
    Join Date
    Dec 1969

    Default image button

    hi, how do i check if a submit button with image is pressed?<BR><BR>on the formpage i have the following line:<BR>---<BR>&#060;input type="image" src="cmd_save.gif" name="cmdEdit"&#062;<BR>---<BR><BR>on the asp page i will check if that button are pressed like this, but this don&#039;t work:<BR>---<BR>if request.form("cmdEdit") &#060;&#062; "" then<BR> response.write "button are pressed"<BR>end if<BR>---<BR><BR>many thanks for help<BR>regards/roger<BR>

  2. #2
    Dalibor Sver Guest

    Default RE: image button

    You should do it on Client Side, using JavaScript. <BR><BR>&#060;input type="image" src="cmd_save.gif" name="cmdEdit" onClick="CheckClick(this)"&#062; <BR><BR>When user clicks button, JS function CheckClick will be callled, for example:<BR><BR>&#060;script language="Javascript"&#062;<BR>function CheckClick(myelement) {<BR>whichelement=document.FORMNAME.myelement.type ;<BR>alert(whichelement + &#039; was clicked!&#039;);<BR>}<BR>&#060;/script&#062;<BR><BR>You can see that you can use this function on various elements and it will return in messagebox which type of element was clicked.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts