Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Manipulating Forms

PhrostBytePhrostByte Posts: 47Member
Anybody know how to submit a form using Javascript?

Also... how do you enable and disable a button?

Thanks everybody!
If you find yourself falling into madness... dive!

Comments

  • Matt(AA)1Matt(AA)1 Posts: 5Member
    The form must have a name in order for you to be able to submit it. A form name looks like:

    FORM NAME="blahblah" METHOD="POST" ACTION="blah.htm"

    To submit a form, you would use the syntax formname.submit(). In this case, the code would look like:

    blahblah.sumbit()

    I believe that this asks the user if they want to submit, so you can't just submit a form without the user knowing :).

    To modify the properties of a button, you must have a button with a name inside a form with a name. Ie:

    FORM NAME="blahblah" METHOD="POST" ACTION="blah.htm"
    BUTTON NAME="blah1"
    SUBMIT NAME="blah2"
    /FORM

    Then, use the boolean property "enabled" to set whether or not the button is enabled (true = enabled, false = disabled). Use the syntax formname.buttonname.enabled = boolean_value. For example:

    blahblah.blah1.enabled = false
    blahblah.blah2.enabled = true

    Hope this helps,
    Matt(AA)



    : Anybody know how to submit a form using Javascript?
    :
    : Also... how do you enable and disable a button?
    :
    : Thanks everybody!If you find yourself falling into madness... dive!
    :


  • PhrostBytePhrostByte Posts: 47Member
    Thanks man, you've helped a lot!


    : The form must have a name in order for you to be able to submit it. A form name looks like:
    :
    : FORM NAME="blahblah" METHOD="POST" ACTION="blah.htm"
    :
    : To submit a form, you would use the syntax formname.submit(). In this case, the code would look like:
    :
    : blahblah.sumbit()
    :
    : I believe that this asks the user if they want to submit, so you can't just submit a form without the user knowing :).
    :
    : To modify the properties of a button, you must have a button with a name inside a form with a name. Ie:
    :
    : FORM NAME="blahblah" METHOD="POST" ACTION="blah.htm"
    : BUTTON NAME="blah1"
    : SUBMIT NAME="blah2"
    : /FORM
    :
    : Then, use the boolean property "enabled" to set whether or not the button is enabled (true = enabled, false = disabled). Use the syntax formname.buttonname.enabled = boolean_value. For example:
    :
    : blahblah.blah1.enabled = false
    : blahblah.blah2.enabled = true
    :
    : Hope this helps,
    : Matt(AA)
    :
    :
    :
    : : Anybody know how to submit a form using Javascript?
    : :
    : : Also... how do you enable and disable a button?
    : :
    : : Thanks everybody!If you find yourself falling into madness... dive!
    : :
    :
    :


    ------------------------------------------
    The art of war is not to die for your country, but to make the other bastard die for his!


Sign In or Register to comment.