Only submit filled in form fields?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Akuma_Devil
Posted On:   Sunday, December 4, 2005 05:47 PM

Hi,


I have a very large form with about 1000 input fields, most of which stay empty. On submit it transfers around 150kB (about 20kB is actually user input).


Is there a way to only submit the form elements that are not empty?


Cheers.

Re: Only submit filled in form fields?

Posted By:   Axel_Richter  
Posted On:   Monday, December 5, 2005 02:05 AM

Hi,



with JavaScript you can run over all elements in your form on submit (onsubmit). Then you can set empty text-fields disabled. Fields that are disabled, are not successful controls. Thus will not submitted.

Example:


"http://www.w3.org/TR/html4/strict.dtd">


remove empty fields















But so you are depended on JavaScript. The better way is IMHO, to split the long form into smaller parts, that can individually be submitted.



Greetings



Axel
About | Sitemap | Contact