Modifying form data before submission

Discussion in 'Javascript' started by Logical, Jul 25, 2003.

  1. Logical

    Logical Guest

    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
    Logical, Jul 25, 2003
    #1
    1. Advertising

  2. Logical

    Chris Wright Guest

    On Fri, 25 Jul 2003 17:43:45 +1000, "Logical" <>
    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.
    Chris Wright, Jul 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrice

    Form Data Submission

    Patrice, Jun 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    367
    barry
    Jun 8, 2006
  2. Sheetal
    Replies:
    3
    Views:
    769
  3. Jared
    Replies:
    5
    Views:
    198
    Jared
    Jul 10, 2003
  4. john
    Replies:
    0
    Views:
    88
  5. Jeremy

    Alter Form values before submission

    Jeremy, Nov 17, 2005, in forum: Javascript
    Replies:
    1
    Views:
    75
Loading...

Share This Page