Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing a Javascript variable in a form?

    I hope this is the correct forum for this question...

    I have an array I've created with javascript that I wish to pass via a form to a php script. I'm using post.

    The array is a list of 15 random questions that my user has answered and we'll say it is named answers[]. How do I send this javascript variable to the php script inside my html form?

    Thanks.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    The submit action sends to the CGI the names/ids and the correspondent values of the form's elements. To pass some javascript varaible's values, you must assign those values to some form's elements (text fields, check boxes, radio buttons, ans so on)
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •