SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2000
    Location
    Arlington, TX USA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I pass the value of a checkbox?
    I have a form with two checkboxes. I would like the checkboxes on the second form to be automatically checked if the first ones were upon hitting submit.
    Any ideas?


  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    It depends on where the two forms are located. Essentially, though, you need to say something like:

    if (document.form1name.checkboxname.checked)
    document.form2name.checkboxname.checked = true;

    if you opened a new window for the second form, you can refer to the original checkbox as: opener.checkboxname
    if it's in frames:
    parent.framename.formname.checkboxname

    Hope this helps
    Vinny


    ------------------
    GrassBlade: cut&paste javascript


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
  •