JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Manipulating Forms Posted by PhrostByte on 17 Aug 2001 at 8:53 PM
Anybody know how to submit a form using Javascript?

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

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

Report
Re: Manipulating Forms Posted by Matt(AA)1 on 23 Aug 2001 at 5:32 PM
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!
:


Report
Re: Manipulating Forms Posted by PhrostByte on 25 Aug 2001 at 3:09 PM
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!





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.