Modifying form data before submission

L

Logical

I have a form which houses basic inputs, as well as a few multiple select
forms.

I need to parse all the 'values' which are in this multiple select form (it
gets manipulated dynamically client side). I wanted to create a function
that loops through all the form elements, and if the type 'select-multiple'
is detected, gather the VALUES of each <option> inside it.

The bit I'm stuck on is then how to reconstruct this into a form submission.
Preferably I wanted the data from the 'select-multiple' element to be
submitted as comma delimited, eg 14,12,512,63,62 which would later be parsed
by PHP.

I was considering reconstructing a query string and submitting that as GET,
but I'd prefer to POST it along with the other data (such as INPUTS etc)
which do not need to be changed.

Can I somehow attach some 'hidden' type data onto the end of the form
submission at this point?

Thanks in advance
 
C

Chris Wright

I have a form which houses basic inputs, as well as a few multiple select
forms.

I need to parse all the 'values' which are in this multiple select form (it
gets manipulated dynamically client side). I wanted to create a function
that loops through all the form elements, and if the type 'select-multiple'
is detected, gather the VALUES of each <option> inside it.

The bit I'm stuck on is then how to reconstruct this into a form submission.
Preferably I wanted the data from the 'select-multiple' element to be
submitted as comma delimited, eg 14,12,512,63,62 which would later be parsed
by PHP.

I was considering reconstructing a query string and submitting that as GET,
but I'd prefer to POST it along with the other data (such as INPUTS etc)
which do not need to be changed.

Can I somehow attach some 'hidden' type data onto the end of the form
submission at this point?
Check the Netscape JavaScript site at http://devedge.netscape.com/
and look at the CFormData JAvaScript object.

That might do the trick for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top