77 users online (1 members and 76 guests)  


  Results 1 to 4 of 4

Related

  1. CSS Buttons and the Submit    Forum: CSS Forum
    Replies: 5
  2. Replies: 19
  3. Submit Buttons [in forms]    Forum: HTML Forum
    Replies: 27
  4. multiple submit buttons in single form    Forum: HTML Forum
    Replies: 7
  5. Images with submit buttons    Forum: HTML Forum
    Replies: 1
  1. #1
    dblyelhd's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2007
    Posts
    2

    Multiple Submit buttons

    I created a form with 12 submit buttons one for ech month. The pirpose of this form is to register the visiter to the mailing list that cooresponds to their birth month. No matter which button I select I alway get registered in December's mailing list (it is the last button) How do I fix this. Here is the code for the form protion of the page.


    Code:
    <td><form action="/cgi-bin/formmail/formmail.cgi" method="post" name="Birthday Club Form" id="Birthday Club Form">
    <p style="margin-top: 0; margin-bottom: 0">
    <label> First Name
    <input name="FirstName" type="text" id="FirstName" tabindex="1" size="25" maxlength="25">
    </label>
    </p>
    <p style="margin-top: 0; margin-bottom: 0">
    <label>Last Name
    <input name="LastName" type="text" id="LastName" tabindex="2" size="25" maxlength="25">
    </label>
    </p>
    <p style="margin-top: 0; margin-bottom: 0">
    <label>Date of Birth
    <input name="DateOfBirth" type="text" id="DateOfBirth" tabindex="3" size="10">
    </label>
    </p>
    <p style="margin-top: 0; margin-bottom: 0">
    <label>Email Address
    <input name="email" type="text" id="email" tabindex="4" size="25" maxlength="40">
    </label>
    &nbsp; </p>
    <p style="margin-top: 0; margin-bottom: 0">&nbsp; </p>
    <div align="center" style="margin-bottom: 0">
    <table width="380" height="185" border="0" align="center" cellpadding="3" cellspacing="3" style="border-collapse: collapse">
    <tr>
    <td width="108" height="61" align="center"><div align="center">
    <p>
    <input name="January" type="submit" id="January" value=" January ">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="January Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="">
    </div></td>
    <td width="109" height="61" align="center"><input name="February" type="submit" id="February" value=" February">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="February Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href="http://www.bonnieandclydehairdesigns.com"></td">http://www.bonnieandclydehairdesigns.com"></td>
    <td width="109" height="61" align="center"><input name="March" type="submit" id="March" value=" March ">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="March Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href="http://www.bonnieandclydehairdesigns.com"></td">http://www.bonnieandclydehairdesigns.com"></td>
    <td width="109" height="61" align="center"><input name="April" type="submit" id="April" value=" April ">
    <div align="center">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="April Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="">
    </div></td>
    </tr>
    <tr>
    <td height="62" align="center"><input name="May" type="submit" id="May" value=" May ">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="May Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href=""></td">"></td>
    <td height="62" align="center"><input name="June" type="submit" id="June" value=" June ">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="June Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href="m"></td">"></td>
    <td height="62" align="center"><input name="July" type="submit" id="July" value=" July ">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="July Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href=""></td">"></td>
    <td height="62" align="center"><input name="August" type="submit" id="August" value=" August ">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="August Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href=""></td">"></td>
    </tr>
    <tr>
    <td height="62" align="center"><input name="September" type="submit" id="September" value="September">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="September Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect7" type="hidden" id="redirect7" value="<A href=""></td">"></td>
    <td align="center"><input type="submit" value=" October " name="October">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="October Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href=""></td">"></td>
    <td align="center"><input name="November" type="submit" id="November" value="November">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="november Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href=""></td">http://www.bonnieandclydehairdesigns.com"></td>
    <td align="center"><input name="December" type="submit" id="December" value="December">
    <input name="recipient" type="hidden" id="recipient" value="">
    <input name="required" type="hidden" id="required" value="FirstName,LastName,email,DateOfBirth">
    <input name="subject" type="hidden" id="subject" value="December Birthday Club for Bonnie and Clyde Hair Designs">
    <input name="redirect" type="hidden" id="redirect" value="<A href=""></td">"></td>
    </tr>
    </table>
    </div>
    </form></td>

    Help would be greatly appreciated.
    Last edited by vinyl-junkie; 07-06-2007 at 10:29 AM. Reason: Added code tags

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Multiple Submit buttons

    All your form fields are part of one gigantic form. Since each form field is repeated within the form (recipient, required, subject and redirect), the submit process only takes the last set of values for these fields. If you want the 12 submit buttons to do different things, you need to give unique names to each of the form fields.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  3. #3
    dblyelhd's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2007
    Posts
    2

    Re: Multiple Submit buttons

    So I would change the (recipient, required, subject and redirect), to (recipient1, required1, subject1 and redirect1) an so forth. Would I not alos have to define these in the formmail.cgi script.

  4. #4
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Multiple Submit buttons

    Quote Originally Posted by dblyelhd View Post
    So I would change the (recipient, required, subject and redirect), to (recipient1, required1, subject1 and redirect1) an so forth. Would I not alos have to define these in the formmail.cgi script.
    Probably. I'm not familiar with that kind of script, so I couldn't help you with how to change that.

    I was also thinking about another possibility after I posted. You could make separate forms to go with each submit button and have an additional field to go with each form, like "month" with a value which corresponded to the number of the month they clicked the submit button for. Then you could leave those fields exactly as they are (recipient, required, subject and redirect). Again though, someone else would need to help you with the script changes necessary to capture and process that additional field.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more



Tags for this Thread