multiple image submit buttons in one form

Discussion in 'ASP General' started by c676228, Mar 19, 2007.

  1. c676228

    c676228 Guest

    Hi all
    I have the following code:
    I am trying to use the value of the image button to evaluate what plan the
    user has chosen, i.e. it request("submit1")="Basic", then the user chose
    basic plan ...
    But when I click one of the image button, the thing is different from what I
    thought.

    it seems that it has field name like submit1.x=24&submit1.y=10, looks like
    the form submit swith the image button position values instead of the value
    of the submit button itself. Am I crazy of doing this way? what should I do?
    Thank you

    <tr>
    <td valign="bottom" style="height:260px;width:200px;
    background-image:url(image/select1_bg.png); background-position:bottom;
    background-repeat:no-repeat"><div align="center"
    style="padding-bottom:15px;color: #333333; font-weight:bold">Total Rate
    <%=FormatCurrency(iBTotalDue)%><br>
    <input type="image" src="image/buynow_voyager.jpg" name="BasicPlan"
    value="Basic" >
    </div></td>
    <td valign="bottom" style="height:260px;width:200px;
    background-image:url(image/select2_bg.png); background-position:bottom;
    background-repeat:no-repeat"><div align="center"
    style="padding-bottom:15px;color: #333333; font-weight:bold">Total Rate
    <%=FormatCurrency(iPTotalDue)%><br>
    <input type="image" src="image/buynow_voyager.jpg" name="PlusPlan"
    value="Plus"
    </div></td>
    <td valign="bottom" style="height:260px;width:200px;
    background-image:url(image/select3_bg.png); background-position:bottom;
    background-repeat:no-repeat"><div align="center"
    style="padding-bottom:15px;color: #333333; font-weight:bold">Total Rate
    <%=FormatCurrency(iETotalDue)%><br>
    <input type="image" src="image/buynow_voyager.jpg" name="ElitePlan"
    value="Elite" >
    </div></td>
    </tr>
    --
    Betty
    c676228, Mar 19, 2007
    #1
    1. Advertising

  2. Hi Betty,

    How are you doing.

    As for the <input type="image" .../> button, I think the value that will be
    submited (related to each image button) is specific to browser. Based on my
    test ,for IE7, it will submit the x, y position of the button, for firefox,
    it will submit x,y postion in as well as the "value" attribute.

    Therefore, for your scenario, I think you may consider a more flexible way
    to distinct the submit from different image(or submit) button. For example,
    you can use a hidden field to mark the clicked submit button and check at
    server-side. Here is a FAQ article that demonstrate the similar approach:

    #When I have multiple submit buttons, how do I tell which was clicked?
    http://classicasp.aspfaq.com/forms/when-i-have-multiple-submit-buttons-how-d
    o-i-tell-which-was-clicked.html

    Hope this helps. If you have any other concerns or questions, please feel
    free to let me know.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Mar 20, 2007
    #2
    1. Advertising

  3. c676228

    c676228 Guest

    Steven,
    Thanks for the late reply and thank you so much for the help.
    Yes, I did use some hidden fields to solve a similar problem in aother
    program. But somehow this Javascript doesn't work in a Mac OS 9.0 with IE 5.x
    installed as I noticed in my monitoring program, somehow customers with this
    system and using IE 5.x fail to submit the request and I cannot figure out
    why(but if firefox is installed or Mac OS 10.0 is installed, everything seems
    fine.) I still cannot figure out what is the best way yet.
    --
    Betty


    "Steven Cheng[MSFT]" wrote:

    > Hi Betty,
    >
    > How are you doing.
    >
    > As for the <input type="image" .../> button, I think the value that will be
    > submited (related to each image button) is specific to browser. Based on my
    > test ,for IE7, it will submit the x, y position of the button, for firefox,
    > it will submit x,y postion in as well as the "value" attribute.
    >
    > Therefore, for your scenario, I think you may consider a more flexible way
    > to distinct the submit from different image(or submit) button. For example,
    > you can use a hidden field to mark the clicked submit button and check at
    > server-side. Here is a FAQ article that demonstrate the similar approach:
    >
    > #When I have multiple submit buttons, how do I tell which was clicked?
    > http://classicasp.aspfaq.com/forms/when-i-have-multiple-submit-buttons-how-d
    > o-i-tell-which-was-clicked.html
    >
    > Hope this helps. If you have any other concerns or questions, please feel
    > free to let me know.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    >
    >
    c676228, Apr 9, 2007
    #3
  4. Thanks for your followup Betty,

    So the problem seems specific to that certain client box. Anyway, if you
    need any help on ASP side programing, please feel free to post here.


    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Apr 11, 2007
    #4
  5. c676228

    c676228 Guest

    Steven,
    Sorry for the type, what I was trying to say is "Sorry for the late reply
    and ..."

    Not "thanks for the late reply and ..." :+(
    --
    Betty


    "c676228" wrote:

    > Steven,
    > Thanks for the late reply and thank you so much for the help.
    > Yes, I did use some hidden fields to solve a similar problem in aother
    > program. But somehow this Javascript doesn't work in a Mac OS 9.0 with IE 5.x
    > installed as I noticed in my monitoring program, somehow customers with this
    > system and using IE 5.x fail to submit the request and I cannot figure out
    > why(but if firefox is installed or Mac OS 10.0 is installed, everything seems
    > fine.) I still cannot figure out what is the best way yet.
    > --
    > Betty
    >
    >
    > "Steven Cheng[MSFT]" wrote:
    >
    > > Hi Betty,
    > >
    > > How are you doing.
    > >
    > > As for the <input type="image" .../> button, I think the value that will be
    > > submited (related to each image button) is specific to browser. Based on my
    > > test ,for IE7, it will submit the x, y position of the button, for firefox,
    > > it will submit x,y postion in as well as the "value" attribute.
    > >
    > > Therefore, for your scenario, I think you may consider a more flexible way
    > > to distinct the submit from different image(or submit) button. For example,
    > > you can use a hidden field to mark the clicked submit button and check at
    > > server-side. Here is a FAQ article that demonstrate the similar approach:
    > >
    > > #When I have multiple submit buttons, how do I tell which was clicked?
    > > http://classicasp.aspfaq.com/forms/when-i-have-multiple-submit-buttons-how-d
    > > o-i-tell-which-was-clicked.html
    > >
    > > Hope this helps. If you have any other concerns or questions, please feel
    > > free to let me know.
    > >
    > > Sincerely,
    > >
    > > Steven Cheng
    > >
    > > Microsoft MSDN Online Support Lead
    > >
    > >
    > >
    > > ==================================================
    > >
    > > Get notification to my posts through email? Please refer to
    > > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > > ications.
    > >
    > >
    > >
    > > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > > where an initial response from the community or a Microsoft Support
    > > Engineer within 1 business day is acceptable. Please note that each follow
    > > up response may take approximately 2 business days as the support
    > > professional working with you may need further investigation to reach the
    > > most efficient resolution. The offering is not appropriate for situations
    > > that require urgent, real-time or phone-based interactions or complex
    > > project analysis and dump analysis issues. Issues of this nature are best
    > > handled working with a dedicated Microsoft Support Engineer by contacting
    > > Microsoft Customer Support Services (CSS) at
    > > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    > >
    > > ==================================================
    > >
    > >
    > >
    > > This posting is provided "AS IS" with no warranties, and confers no rights.
    > >
    > >
    > >
    > >
    c676228, Apr 13, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. D. Shane Fowlkes
    Replies:
    3
    Views:
    626
    S. Justin Gengo
    Feb 24, 2004
  2. Matt
    Replies:
    0
    Views:
    683
  3. Replies:
    4
    Views:
    901
  4. Matt
    Replies:
    2
    Views:
    159
    Bob Barrows [MVP]
    Jun 27, 2004
  5. Matt
    Replies:
    1
    Views:
    201
    Thomas 'PointedEars' Lahn
    Jul 5, 2004
Loading...

Share This Page