Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Modifying form data before submission

Reply
Thread Tools

Modifying form data before submission

 
 
Logical
Guest
Posts: n/a
 
      07-25-2003
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


 
Reply With Quote
 
 
 
 
Chris Wright
Guest
Posts: n/a
 
      07-25-2003
On Fri, 25 Jul 2003 17:43:45 +1000, "Logical" <(E-Mail Removed)>
wrote:

>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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL newbie- stuck just weeks before project submission :(..pleasehelp Sheetal VHDL 3 08-10-2010 06:59 PM
Form Data Submission Patrice ASP .Net 1 06-08-2006 02:26 AM
Alter Form values before submission Jeremy Javascript 1 11-17-2005 08:24 PM
Anyway to 'save' text from form textboxes before submission? john Javascript 0 09-09-2003 02:51 PM
Form Submission: Final URL that has form options included ?? Jared Javascript 5 07-10-2003 10:33 AM



Advertisments