Community Forums 

Main Content

2 drop downs and 2 text boxes

    Jul 03 2011 20:33:09

    #1

    Don

    Join date : 2008-09-18      Posts : 487

    I am usually pretty good at sorting out drop down problems, but this one I cannot fathom out.

    I need a form for 2 drop downs and 2 text boxes to show in the cart on a single line only as - data1, data2, data3, data4.

    I have tried altering this code of GTs - 2 dropdown's plus a text box - but to no avail.

    If anyone can help, it would be most appreciated.

    Thanks in anticipation.

    DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 03 2011 21:00:22

    #2

    Alan

    Join date : 2008-09-18      Posts : 2950

    I duplicated the textarea statement and it gave me
    Adult Fleece-Lined Hooded Jacket, Black, 4XL, text1, text2

    Alan
    Some shipping help documents are available at www.stoner.org.uk/mals/




    Jul 03 2011 22:09:03

    #3

    Don

    Join date : 2008-09-18      Posts : 487

    Alan,

    Doh - Spot on, I should have gone to 'specsavers'.

    DB

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 03 2011 22:51:25

    #4

    Don

    Join date : 2008-09-18      Posts : 487

    However, I don't want such big text boxes, I only want size="3", if I change to size="3" the form loses the function to add the 4 lots of data to the cart ?

    DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 04 2011 04:42:06

    #5

    GT

    Join date : 2008-09-18      Posts : 3207

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

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




    Jul 04 2011 05:33:46

    #6

    Alan

    Join date : 2008-09-18      Posts : 2950

    I don't think textarea has a size attribute so the result may be browser dependent.

    Alan
    Some shipping help documents are available at www.stoner.org.uk/mals/




    Jul 04 2011 10:08:32

    #7

    Don

    Join date : 2008-09-18      Posts : 487

    Thanks for all your inputs.

    I have managed to get all the data info Boxes working but the validation on Box3 & Box4 is not working.

    I have stripped the non relevant info from the page which can be seen here www.donbarrow.co.uk/new_validation_selector_04-07-11.html

    Any help most appreciated.

    DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 04 2011 12:39:51

    #8

    Geoff

    Join date : 2008-09-18      Posts : 415

    1. Because Box 3 and 4 are text inputs not selects, your function should read

    function check(formname, submitbutton,) {
    var errors = '';
    errors += checkSelect(formname, 'Box1', 'Box1');
    errors += checkSelect(formname, 'Box2', 'Box2');
    errors += checkText(formname, 'Box3', 'Box3');
    errors += checkText(formname, 'Box4', 'Box4');
    checkThisForm(formname, submitbutton, errors);
    }

    2. The attributes id="Box3" and id="Box4" should be attached to the text inputs not the hidden inputs.

    3. The script assumes no pre-filled value for the text inputs. If you want pre-filled data, this should be entered into the value part of the checkText function in the script.

    3. The submit apparently needs to be a button not a submit input or image or else the process continues after the alert is removed thereby rendering the validation pointless. I don't yet have an answer to this.



    Jul 04 2011 12:55:07

    #9

    Don

    Join date : 2008-09-18      Posts : 487

    Thanks once again everyone.

    I shall alter to suit Geoff.

    DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook