Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   HTML Parameters to document.form.submit() (http://www.programmingforums.org/showthread.php?t=12112)

commodore Dec 5th, 2006 11:28 AM

HTML Parameters to document.form.submit()
 
I have a submit similar to this <input type="submit" class="asdf"....
How can I use the "class=""" with javascript's document.form.submit() or do I have to use some other trick?

DaWei Dec 5th, 2006 11:59 AM

Why don't you just use the name or id?

commodore Dec 5th, 2006 12:58 PM

What name? What id?

I now know that I need the "name=""" attribute included with it.

And I do type "document.myformname.submit()" not "document.form.submit()".

BlackDal Dec 7th, 2006 6:28 AM

you want submit your form from jscript code?
then you don't need class property!(and you can't use it for submit method)
class is a UI property for HTML elements.

Arevos Dec 7th, 2006 6:49 AM

Quote:

Originally Posted by BlackDal (Post 120750)
(and you can't use it for submit method)

Well, you can, but it's easier to use the id or form name.

BlackDal Dec 9th, 2006 12:16 PM

Quote:

Originally Posted by Arevos (Post 120751)
Well, you can, but it's easier to use the id or form name.

yes I know it! for submiting a form should use ID of form but no class property
class property say which class of styles (style tag or CSS file) should apply on element. when I don't understand why(and what) you use class property in submit method

Mr/Mrs commodore you can submit your form by a code like this:
:

document.FormName.ElementID.value = 'ElementValue';
//.. and for other form elements
document.FormName.method = 'Method Type';
document.FormName.action = 'Action Target';
document.FormName.submit(); //this method gives no parametere



All times are GMT -5. The time now is 1:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC