Javascript array in GET

Discussion in 'Javascript' started by UKuser, Jul 18, 2007.

  1. UKuser

    UKuser Guest

    Hi,

    I have a form which is created with PHP and has each input/text box as
    a name[num].

    What I want is to use ajax to send each the contents of the boxes in a
    get statement as if it were a PHP post or get statement.

    I.e.
    <input type="text" name="prop[1]" value="eds" style="width:150px" />
    <input type="text" name="prop[2]" value="eds" style="width:150px" />
    <input type="text" name="prop[3]" value="n4" style="width:150px" />

    I want my javascript to get the contents of each of the boxes and post
    it to my php script from where I can process it. It will be passed to
    the php script as a GET statement.

    I am trying to use the getElement/s lines, but I am not a javascript
    guru and struggling a bit.

    Any help would be great.

    Thanks

    A
    UKuser, Jul 18, 2007
    #1
    1. Advertising

  2. Randy Webb wrote:
    > David Mark said the following on 7/18/2007 10:33 AM:
    >> "UKuser" <> wrote [...]:
    >>> <input type="text" name="prop[1]" value="eds" style="width:150px" />
    >>> <input type="text" name="prop[2]" value="eds" style="width:150px" />
    >>> <input type="text" name="prop[3]" value="n4" style="width:150px" />

    >> Those are not valid names for a start.

    >
    > [...] Oh wait, you are falling back on the XHTML sword where they
    > are invalid. [...]


    Not at all.

    ,-<http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
    |-<http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
    |-<http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd>
    |
    | <!ATTLIST input
    | %attrs;
    | %focus;
    | type %InputType; "text"
    | name CDATA #IMPLIED
    | [...]

    ,-<http://www.w3.org/TR/2006/WD-xhtml-modularization-20060705/dtd_module_defs.html#sec_F.3.4.>
    |
    | <!ENTITY % input.qname "input" >
    | [...]
    | <!ATTLIST %input.qname;
    | %Common.attrib;
    | type %InputType.class; 'text'
    | name CDATA #IMPLIED
    | [...]


    PointedEars
    --
    var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
    ) // Plone, register_function.js:16
    Thomas 'PointedEars' Lahn, Aug 1, 2007
    #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. Replies:
    2
    Views:
    1,447
  2. markspace
    Replies:
    1
    Views:
    378
    markspace
    Jun 25, 2009
  3. Mara Guida

    const and array of array (of array ...)

    Mara Guida, Sep 2, 2009, in forum: C Programming
    Replies:
    3
    Views:
    473
    David RF
    Sep 3, 2009
  4. Tom
    Replies:
    3
    Views:
    197
    salsablr
    Dec 20, 2004
  5. Tuan  Bui
    Replies:
    14
    Views:
    462
    it_says_BALLS_on_your forehead
    Jul 29, 2005
Loading...

Share This Page