SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How would I know which submit button in JavaScript was clicked from rendered HTML:

    I need to know which button was just clicked and extract its submitbuttonnextstatusid's value and submit the form with that value.

    These are dynamically created button on the fly and I can't change the HTML.

    Code:
    <input type="submit" class="ButtonSm" onclick="this.form.submitbuttonid.value='FlpZTFMaYgVeRGgOc0QOFDRhZikBbnV2H2BZ';this.form.dele.value=0;this.form.submitbuttonnextstatusid.value=25269;this.form.save.value=1;this.form.butaction.value=2;" value="Accounting" id="submitbutton">
    
    <input type="submit" class="ButtonSm" onclick="this.form.submitbuttonid.value='F0l7LUhlZxpRGRc8KhBUHDVUZxIsHgwyH2FY';this.form.dele.value=0;this.form.submitbuttonnextstatusid.value=25264;this.form.save.value=1;this.form.butaction.value=3;" value="Awaiting Dictation" id="submitbutton_25">

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    These are dynamically created button on the fly and I can't change the HTML.
    Yes you can Give the inputs a name attribute and that will get passed through in the request.


Bookmarks

Posting Permissions

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