Thread: forms

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    brussels
    Posts
    7
    Rep Power
    0
    I have a one page form in my PHP4, with two part ( like first part is billing information and second part delivery section).
    I just dont know when the billing and delivery informations are the same how with a check box let the visitors to fill the second part automaticaly?

    Trust your science,
    Mashadi


    ------------------
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Seaside, CA
    Posts
    84
    Rep Power
    15
    mashadi,

    If you have a table for billing and a table for delivery, and they check the box to use the same address for both, then you'll need to do two INSERT statements, one to put the address info into its table and one to put the delivery info in to the other table.

    If you have one table for both (which would be less efficient), then just insert, for example, the "city" twice, once into b_city and once into d_city.

    ------------------
    From the day we're born, we're running out of time.

    [This message has been edited by JoelFord (edited August 13, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Austin, TX, USA
    Posts
    11
    Rep Power
    0
    Your php code would look something like this do get to the second statement.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    if (!checkbox) {
    2nd insert statement;
    }
    [/code]

    This says that if checkbox is not true (or not set) then do the second insert statement with the 2nd set of form elements. So what you are accomplishing is that if the customer has not checked the checkbox it does the 2nd insert statment.

    Since a checkbox is automatically a boolean, all you have to do is see if it is set. Also, isset (checkbox) would work instead of an if statement.

    ------------------
    Dave Bryant
    dbryant@jump.net

    [This message has been edited by davebryant (edited August 13, 2000).]

    [This message has been edited by davebryant (edited August 14, 2000).]

Similar Threads

  1. ASP.net v Oracle Forms - what is best
    By msjodin in forum Oracle Development
    Replies: 0
    Last Post: February 10th, 2004, 11:04 AM
  2. pdf forms?
    By bellcom in forum Web Design Help
    Replies: 0
    Last Post: January 31st, 2004, 09:08 PM
  3. One confirmation email, two different forms
    By sisleysusie in forum PHP Development
    Replies: 3
    Last Post: January 26th, 2004, 10:26 PM
  4. Putting/submitting lots of forms on one page
    By rampguy in forum PHP Development
    Replies: 1
    Last Post: December 5th, 2003, 10:47 PM
  5. Dynamic forms that change by user interactions?
    By BassPlayer in forum PHP Development
    Replies: 4
    Last Post: April 4th, 2003, 03:05 AM

IMN logo majestic logo threadwatch logo seochat tools logo