SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2003
    Location
    UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing variables between web pages

    Hi everybody,

    I am attempting to display info put into an array from an onClick() event in a different page - I have created different functions which populate an array with different info dependant on which link the visitor clicks ie
    HTML Code:
    <a href="nextpage.htm" onClick="functiontopopulatearray()"> SELECT</a>
    The function seems to work fine, however when the next page loads and I attempt to access the array elements they are now undefined - both pages are linked to the same JS document.

    Hope I'm not being too vague - I'm tearing my hair out here so hope someone can help

    Yvonne

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This example might be helpful.

  3. #3
    SitePoint Member
    Join Date
    Dec 2003
    Location
    UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The example helps, thanks - I've done a bit of a rejig and now have a page displaying a list of text options with checkboxes, the visitor should be able to select any number of checkboxes and then have their selections displayed on the next page ie

    HTML Code:
    <form action="nextpage.htm" method="get" name="form1" >
    <input type="checkbox" name="checkbox1" value="first value">
    
    <input type="checkbox" name="checkbox2" value="second value">
    
    <input type="checkbox" name="checkbox3" value="third value">
    </form>
    How can I make sure only the values of the selected options are displayed on the next page?

    Yvonne


Bookmarks

Posting Permissions

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