Help with forms - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help with forms

elideeelidee Posts: 1Member
Can anyone help???
I have a form, which submits data to my, mysql database using php.
However I want to use javascript to validate the fields.... I've found a few online I thought i could use to teach myself, but I'm finding I can't make it submit the data to my database.....

can someone help..... I haven't a clue at all

example of my form....

*required field


































*Manager

Claire McCall
Gillian Howieson
Neil Sinclair
Initial
*Surname:
House
address line 1
*table_name

BG_NRG_DF_ERT_07032005
BG_NRG_DF_ERT_12022005

Notes



Comments

  • mac_doggiemac_doggie Posts: 488Member
    [b][red]This message was edited by mac_doggie at 2005-4-6 13:14:59[/red][/b][hr]
    : Can anyone help???
    : I have a form, which submits data to my, mysql database using php.
    : However I want to use javascript to validate the fields.... I've found a few online I thought i could use to teach myself, but I'm finding I can't make it submit the data to my database.....
    :
    : can someone help..... I haven't a clue at all
    :
    [code]


    function Validate(theForm) {
    msg = '';
    if(theForm.elements['element'] != '') {
    msg += 'You have to fill in element
    ';
    }

    // etc...

    if(msg != '') {
    result = false;
    alert(msg);
    }else {
    result = true;
    }

    // I see I forgot to return a value here sorry, did this in a hurry this morning... Now it should work I think
    return result;
    }

    function SubmitForm(theForm) {
    if(Validate(theForm)) {
    theForm.Submit();
    }
    }





    etc...

    Submit

    [/code]
    ;-)
    -mac-
    mailto:[email protected]
    the Netherlands...




Sign In or Register to comment.