Community Forums 

Main Content

Form not working

    Feb 27 2009 07:53:19

    #1

    pcguy

    Join date : 2008-09-18      Posts : 130

    What have I done wrong in this code here it won't work. I know it is simple but I have been looking at it for hours and my mind has gone blank.

    <form action="http://ww11.aitsafe.com/cf/add.cfm"; method="post" target="viewer">
    <input name="userid" type="hidden" value="D612946" />
    <input name="return" type="hidden" value="www.mysite.com">;
    <input type="hidden" name="qty" value="1">
    <input type="hidden" name="price" value="45.00">

    <p><b>Virus Removal Booking</b></br>
    <br>
    <p>Enter your date and time, please give at least 2 alternatives.</br>
    <br>Price: Only $45.00</p>
    Preferred Date/Time
    <p><input type="text" name="product1" size="10">
    <select name="product1">
    <option value="Time" selected=""></option>
    <option value="Prefered Time - 9am, :45.00">9am</option>
    <option value="Prefered Time - 10am, :45.00">10am</option>
    <option value="Prefered Time - 11am, :45.00">11am</option>
    <option value="Prefered Time - 12pm, :45.00">12pm</option>
    <option value="Prefered Time - 1pm, :45.00">1pm</option>
    <option value="Prefered Time - 2pm, :45.00">2pm</option>
    <option value="Prefered Time - 3pm, :45.00">3pm</option>
    <option value="Prefered Time - 4pm, :45.00">4pm</option>
    <option value="Prefered Time - 5pm, :45.00">5pm</option>
    </select></p>



    1st Alternative
    <p><input type="text" name="product2" size="10">
    <select name="product2">
    <option value="Time" selected=""></option>
    <option value="1st Alternative Time - 9am, :45.00">9am</option>
    <option value="1st Alternative Time - 10am, :45.00">10am</option>
    <option value="1st Alternative Time - 11am, :45.00">11am</option>
    <option value="1st Alternative Time - 12pm, :45.00">12pm</option>
    <option value="1st Alternative Time - 1pm, :45.00">1pm</option>
    <option value="1st Alternative Time - 2pm, :45.00">2pm</option>
    <option value="1st Alternative Time - 3pm, :45.00">3pm</option>
    <option value="1st Alternative Time - 4pm, :45.00">4pm</option>
    <option value="1st Alternative Time - 5pm, :45.00">5pm</option>
    </select></p>

    <br>
    2nd Alternative
    <p><input type="text" name="product3" size="10">
    <select name="product3">
    <option value="Time" selected=""></option>
    <option value="2nd Alternative Time - 9am, :45.00">9am</option>
    <option value="2nd Alternative Time - 10am, :45.00">10am</option>
    <option value="2nd Alternative Time - 11am, :45.00">11am</option>
    <option value="2nd Alternative Time - 12pm, :45.00">12pm</option>
    <option value="2nd Alternative Time - 1pm, :45.00">1pm</option>
    <option value="2nd Alternative Time - 2pm, :45.00">2pm</option>
    <option value="2nd Alternative Time - 3pm, :45.00">3pm</option>
    <option value="2nd Alternative Time - 4pm, :45.00">4pm</option>
    <option value="2nd Alternative Time - 5pm, :45.00">5pm</option>
    </select></p>

    </p>

    <input type="submit" value="Book my Scan!">
    </form>



    Feb 27 2009 13:22:03

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    A few errors in your form, try this:

    <form action="http://ww11.aitsafe.com/cf/add.cfm"; method="post" target="viewer">
    <input name="userid" type="hidden" value="D612946">
    <input name="return" type="hidden" value="www.mysite.com">;
    <input type="hidden" name="qty" value="1">
    <input type="hidden" name="price" value="45.00">

    <p><b>Virus Removal Booking</b></p>
    <p>Enter your date and time, please give at least 2 alternatives.</br><br>Price: Only $45.00</p>
    <p>Preferred Date/Time<br>
    <select name="product[]">
    <option value="Prefered Time - 9am,">9am</option>
    <option value="Prefered Time - 10am,">10am</option>
    <option value="Prefered Time - 11am,">11am</option>
    <option value="Prefered Time - 12pm,">12pm</option>
    <option value="Prefered Time - 1pm,">1pm</option>
    <option value="Prefered Time - 2pm,">2pm</option>
    <option value="Prefered Time - 3pm,">3pm</option>
    <option value="Prefered Time - 4pm,">4pm</option>
    <option value="Prefered Time - 5pm,">5pm</option>
    </select>
    <input type="text" name="product[]" size="10">
    </p>

    <p>1st Alternative<br>
    <select name="product[]">
    <option value="1st Alternative Time - 9am,">9am</option>
    <option value="1st Alternative Time - 10am,">10am</option>
    <option value="1st Alternative Time - 11am,">11am</option>
    <option value="1st Alternative Time - 12pm,">12pm</option>
    <option value="1st Alternative Time - 1pm,">1pm</option>
    <option value="1st Alternative Time - 2pm,">2pm</option>
    <option value="1st Alternative Time - 3pm,">3pm</option>
    <option value="1st Alternative Time - 4pm,">4pm</option>
    <option value="1st Alternative Time - 5pm,">5pm</option>
    </select>
    <input type="text" name="product[]" size="10">
    </p>

    <p>2nd Alternative<br>
    <select name="product[]">
    <option value="2nd Alternative Time - 9am,">9am</option>
    <option value="2nd Alternative Time - 10am,">10am</option>
    <option value="2nd Alternative Time - 11am,">11am</option>
    <option value="2nd Alternative Time - 12pm,">12pm</option>
    <option value="2nd Alternative Time - 1pm,">1pm</option>
    <option value="2nd Alternative Time - 2pm,">2pm</option>
    <option value="2nd Alternative Time - 3pm,">3pm</option>
    <option value="2nd Alternative Time - 4pm,">4pm</option>
    <option value="2nd Alternative Time - 5pm,">5pm</option>
    </select>
    <input type="text" name="product[]" size="10">
    </p>

    <p><input type="submit" value="Book my Scan!"></p>
    </form>

    Mals forms are at: http://www.tne.co.uk/mals/

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Feb 28 2009 08:43:15

    #3

    pcguy

    Join date : 2008-09-18      Posts : 130

    Thanks GT that works perfect.

    just one other question how can I add an onclick alert to the form I have tried this but it adds nothing to the cart

    onclick="alert('Booking dates have been added to your cart\nPress OK to continue to shop or\nClick the View Cart icon to checkout');">



    Feb 28 2009 12:15:30

    #4

    GT

    Join date : 2008-09-18      Posts : 3207

    Try removing target="viewer" and then have your button like this:
    <input type="submit" value="Book my Scan!" onclick="alert('Booking dates have been added to your cart\nPress OK to continue to shop or\nClick the View Cart icon to checkout');">

    You might be best having a change in your words as the only option for the viewer is to click 'ok'.

    hih.

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.