Hello JS Experts,
I have an HTML page containing forms and many form input elements like radio buttons, check boxes, selection lists etc. When page is served, user will select and modify some or all of the form elements, I want to control the form submission content... that is I want to send only the modified elements to the server not all the elements that are present in the form ( because I am working on an embedded web server application, any processing intelligence like discarding the input elements which have not changed will be overhead and it caters to maintaing each form content which has been served- and then comparing with the response ).
I am able to find the elements which have changed using javascript event handlers but not able to find the method for deleting a form element.
Is there any method through which I can delete the form element, and then submit only the changed elements through POST method.
Any pointers in this direction is most welcome....
Thanks in advance
-Chandra
Comments
(qs="?dummy=0")
Loop through the changed elements
For each element, get the name and value
qs+="&"+element_name+"="+element_value;
when this is done, you have a querystring in qs that only contain changed form-values. Now you change the action-attribute of the FORM-tag:
forms[0].action="filename.asp"+qs;
Ready to POST!
so essentially, a
frmElementObj.value = Null;
would do the trick. Dunno if that's what you are asking.