#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    45
    Rep Power
    12

    passing change state of checkbox to the main form


    Hi everyone
    I have a form which contains multiple rows. Corresponding to each row there is an edit link. When edit is clicked the a new window opens which contains the elements of that row prefilled. The problem comes when I have to pass the changed values back. For text fields I am doing
    function sendtext()
    {
    self.opener.document.forms[0].elements['one'].value = document.forms['frm1'].elements[0].value
    self.opener.document.forms[0].elements['two'].value = document.forms['frm1'].elements[1].value
    }
    It works perfectly fine. The problem is with a checkbox. How do I pass the changed state of checkbox to the checkbox in the main form.

    plzz help
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    11
    Rep Power
    0
    self.opener.document.forms[0].your_check_box.checked = document.forms['frm1'].your_other_check_box.checked
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Italy, EU
    Posts
    517
    Rep Power
    12
    Have you tried with this?
    Code:
    self.opener.document.forms[0].elements['xxx'].checked = document.forms['frmX'].elements[n].checked
    I haven't tested it but should work...

    Hope this helps!
    Cheers, Dave
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    14
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    45
    Rep Power
    12
    thank you so much for your help.
    Its works

IMN logo majestic logo threadwatch logo seochat tools logo