Validating two forms on one page

Discussion in 'HTML & Website Design' started by astra, Feb 27, 2009.

  1. #1
    Hello everyone,
    I have two contact forms on one page. Both need to be validated. I used DreamWeaver form validation behavior. The problem is when I validate two forms on the same page it does not work. Works perfectly for 1 form per page though.

    Is there any solution for this problem?
    I'll be very thankful for any help.

    astra
     
    astra, Feb 27, 2009 IP
  2. rebelagent

    rebelagent Well-Known Member

    Messages:
    876
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    165
    #2
    What do you mean by validating? Checking for errors or incomplete sections? Or actually completing the form so it sends to where it's supposed to go?

    If I have two forms on one page I have to make sure all my fields have different name="" or else the validation page gets confused.

    So lets say you have one contact form that wants a person to register for a mailing lists and it requires name, address, phone number
    Then you have another contact form that wants a person to register for the site which requires a name, address, phone number, and password.

    Both forms will need to be identified differently. You can use the same validation page instead of two different validation pages by simply renaming the 2nd forms values.

    So form one would be
    name="name"
    address="address"
    phone="phone"

    and form 2 needs to look like this
    name="name1"
    address="address2"
    phone="phone2"

    Otherwise the validation gets all screwy.
     
    rebelagent, Feb 27, 2009 IP
  3. astra

    astra Peon

    Messages:
    53
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you very much for your reply. Both forms are for newsletter subscription. I needed to make sure all fields were filled in.

    I double checked to make sure the fields have different id names and it looks like both forms are working the way they should.

    Thanks so much again!!
     
    astra, Feb 27, 2009 IP
    rebelagent likes this.