creating a complex form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • info@gozuidafrika.com

    #1

    creating a complex form

    I am having trouble inserting more then one row into a mysql database.
    this is what I won't to do.

    I am setting up a survey to see what customers think of the hotels we
    booked for them. A form shows all the hotels booked by us voor a
    perticulair client sorted by hotel. Next to it is a radio group
    (example: excellent - good - not good)

    The list of hotels booked by the client is show with a repeat region.
    Following problems need to be overcome

    1. per listed hotel the buttongroup needs to know its a new row
    2. clients need to judge (via de selection of radio buttons in the
    radio button group) how they feel the hotel was
    3. to confirm the clients presses 1 submit button and the data is
    added to the database

    Hope anyone can help

    Table where the data must be inserted looks like

    surveyID (auto increases)
    offerteID (hidden form var)
    hotelID (hidden form var)
    rateID (radio button group) values are 1 (excellent) 2 (good) 3
    (avereage) 4 (below average) 5 (bad)
    remarks (formfield)
  • Captain Paralytic

    #2
    Re: creating a complex form

    On 7 Aug, 16:00, "i...@gozuidafr ika.com" <i...@gozuidafr ika.com>
    wrote:
    I am having trouble inserting more then one row into a mysql database.
    this is what I won't to do.
    >
    I am setting up a survey to see what customers think of the hotels we
    booked for them. A form shows all the hotels booked by us voor a
    perticulair client sorted by hotel. Next to it is a radio group
    (example: excellent - good - not good)
    >
    The list of hotels booked by the client is show with a repeat region.
    Following problems need to be overcome
    >
    1. per listed hotel the buttongroup needs to know its a new row
    2. clients need to judge (via de selection of radio buttons in the
    radio button group) how they feel the hotel was
    3. to confirm the clients presses 1 submit button and the data is
    added to the database
    >
    Hope anyone can help
    >
    Table where the data must be inserted looks like
    >
    surveyID (auto increases)
    offerteID (hidden form var)
    hotelID (hidden form var)
    rateID (radio button group) values are 1 (excellent) 2 (good) 3
    (avereage) 4 (below average) 5 (bad)
    remarks (formfield)
    What have you tried? What were the problems. If you want me to design
    this from scratch, what's your budget?

    Comment

    • larry@portcommodore.com

      #3
      Re: creating a complex form

      On Aug 7, 8:00 am, "i...@gozuidafr ika.com" <i...@gozuidafr ika.com>
      wrote:
      I am having trouble inserting more then one row into a mysql database.
      this is what I won't to do.
      >
      I am setting up a survey to see what customers think of the hotels we
      booked for them. A form shows all the hotels booked by us voor a
      perticulair client sorted by hotel. Next to it is a radio group
      (example: excellent - good - not good)
      >
      The list of hotels booked by the client is show with a repeat region.
      Following problems need to be overcome
      >
      1. per listed hotel the buttongroup needs to know its a new row
      2. clients need to judge (via de selection of radio buttons in the
      radio button group) how they feel the hotel was
      3. to confirm the clients presses 1 submit button and the data is
      added to the database
      >
      Hope anyone can help
      >
      Table where the data must be inserted looks like
      >
      surveyID (auto increases)
      offerteID (hidden form var)
      hotelID (hidden form var)
      rateID (radio button group) values are 1 (excellent) 2 (good) 3
      (avereage) 4 (below average) 5 (bad)
      remarks (formfield)
      You need to use arrays read in your db rows into fields, to set up
      your form and retrieve your data.

      so SurveyID would be SurveyID[1]-SurveyID[20] or whatever.

      Comment

      • Sjoerd

        #4
        Re: creating a complex form

        On Aug 7, 5:00 pm, "i...@gozuidafr ika.com" <i...@gozuidafr ika.com>
        wrote:
        Following problems need to be overcome
        >
        1. per listed hotel the buttongroup needs to know its a new row
        2. clients need to judge (via de selection of radio buttons in the
        radio button group) how they feel the hotel was
        3. to confirm the clients presses 1 submit button and the data is
        added to the database
        With this HTML:

        <form method="POST" action="bla.php ">

        <input type="radio" name="rating[0]" value="bad">Bad
        <input type="radio" name="rating[0]" value="average" Average
        <input type="radio" name="rating[0]" value="good"Goo d
        <br />

        <input type="radio" name="rating[1]" value="bad">Bad
        <input type="radio" name="rating[1]" value="average" Average
        <input type="radio" name="rating[1]" value="good"Goo d
        <br />

        <input type="radio" name="rating[2]" value="bad">Bad
        <input type="radio" name="rating[2]" value="average" Average
        <input type="radio" name="rating[2]" value="good"Goo d
        <br />
        <input type="submit"/>
        </form>


        The data in $_POST will become something like this:

        Array
        (
        [rating] =Array
        (
        [0] =bad
        [1] =bad
        [2] =good
        )

        )

        Comment

        Working...