How to get a Form object in javascript?
Function or method to dynamically submit a form?
DOM Method | Description | Example |
submit() | Used to dynamically submit a form using javascript | To Submit: document.tform.submit(); |
reset() | Used to dynamically reset the values of the form | To Blur: document.tform.reset(); |
handleEvent() | Used to invoke event handlers | |
DOM Property | Description | Example |
action | Used to get or set the action attribute of form field. | To Get: var ss = document.tform.action; To Set: document.tform.action = "form-object.php"; |
elements | property "elements" returns an array containing all the objects (like button, checkbox, etc..) in a form | To Get: var ss = document.tform.elements; |
encoding | Used to get or set the enctype attribute of form field. | To Get: var ss = document.tform.encoding; To Set: document.tform.encoding = ""; |
length | Property "length" is used to check the number of elements present in the form. | To Get: var ss = document.tform.length; |
method | Property "method" is used get or set the attribute "method" of form field as POST or GET. | To Get: var ss = document.tform.method; To Set: document.tform.method= "GET"; |
name | Property "name" is used to get or set the name of the form. | To Get: var ss = document.tform.name; |
target | Property "target" is used get or set the attribute "target" of the form. | To Get: var ss = document.tform.target; To Set: document.tform.target = "xxxx"; |