Pass value from Submit button Image ? Possible?

Results 1 to 3 of 3

Thread: Pass value from Submit button Image ? Possible?

  1. #1
    Mark Guest

    Default Pass value from Submit button Image ? Possible?

    Hi All,<BR><BR>I&#039m starting to think this is just not possible!<BR><BR>I have an ASP form that has multiple buttons in it. I assign a name/value pair to each button, which on submission tells my page what to do next. ( Ie: input type=submit name=action value=delete ). It&#039s then a simple matter of using "if request("action") =.. etc to determine what happens next.<BR><BR>This all works fine when using standard form buttons, but I also want to replace the buttons with custom images. However, it seems that the *input type=image* does not support the passing of a name/value pair. Has anyone figured out a way to do this ?<BR><BR>Would much appreciate any hints, tia :c)<BR><BR>Mark

  2. #2
    Sathiya Guest

    Default RE: Pass value from Submit button Image ? Possible

    Hire me i will tell you , just kidding . But ont use input type="image" some times it gives error in Netscape.<BR><BR>&#060;a href="javascript:FSubmit(&#039Save&#039);"&#062;&# 060;img src="../images/save.gif"&#060;/a&#062;<BR>&#060;a href="javascript:FSubmit(&#039Cancel&#039);"&#062; &#060;img src="../images/cancel.gif"&#060;/a&#062;<BR><BR><BR>function FSubmit(EValue)<BR>{<BR>document.FormName.SomeHidd enVariable.value = EValue;<BR>document.FormName.submit(); <BR>}<BR><BR>Then inside the Form have<BR>&#060;input type="hidden" name="SomeHiddenVariable"&#062;<BR><BR>Then inside Server script<BR>Request("SomeHiddenVariable")<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Pass value from Submit button Image ? Possible

    When using images as submit buttons, all form information is passed as well as the coordinate pressed. The name/value pair is not supported. a way to check to see which button was pressed is as follows:<BR><BR>&#060;input type=image name=save...&#062;<BR>&#060;input type=image name=cancel...&#062;<BR><BR>then in ASP use:<BR>if request("save.x") &#060;&#062; "" then<BR>code for save<BR>else (possible check for request("cancel.x"))<BR>code for cancel<BR>end if<BR><BR>save.y also works for this.

Posting Permissions

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