Array from hidden form elements?

Discussion in 'Web Design and Development' started by tominated, Sep 3, 2007.

  1. tominated macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #1
    I am trying to make an ajax shopping cart for my website that will interface with a service called e-junkie. What I have done is using javascript and jquery, I include little blocks of html with a hidden form element in it (with the e-junkie product ID in it) for each item as it is clicked, but I would like to know how it can be used as an array in the url as stated at http://www.e-junkie.com/ej/help.php#q3 . If you want i'll include the code. BTW: I am a bit of a noob with javascript and I can use PHP, barely.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Well the "#q3" part at the end of the URL acts like a internal link, which is likely what you want. For that to work, the HTML tag must have "q3" as the "id" "name" attribute value set to q3. Though I'm not sure what the effect will be for a hidden item. I've never tried, should be easy to try.
     
  3. tominated thread starter macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #3
    well, not quite, i don't want an internal link as e-junkie requires the link to be along the lines of this:
    Code:
    https://www.e-junkie.com/ecom/gb_tpc.php?item_number_array=1,5,7,9
    &quantity_array=1,1,1,2&cl=client_id_from_your_buy_now_buttons
    I want to find the all the elements with the name attribute set as id and get their id. Then I want to make it a comma separated array and I will take it from there.
     

Share This Page