www.webdeveloper.com
Results 1 to 3 of 3

Thread: how to pass label value using javascript to pop window in html

  1. #1
    Join Date
    Oct 2011
    Location
    INDIA
    Posts
    5

    Smile how to pass label value using javascript to pop window in html

    <table border="1" bgcolor="#C0C0C0" cellpadding="3" cellspacing="3"width="250">
    <tr>
    <th>Select</th>
    <th>Documenet Name</th>
    </tr>
    <tr>
    <td><input type="checkbox" ID="chk1" name="check1" /></td>
    <td><label for="chk1">Word File.doc</label></td>
    </tr>
    <tr>
    <td><input type="checkbox" ID="chk2" name="check2" /></td>
    <td><label for="chk2">PDF File.pdf</label></td>
    </tr>
    <tr>
    <td><input onClick="myPopup()" type="submit" name="button" value="Print" width="100px"></td>
    </tr>

    i want to display value of label "word file.doc" etc in pop up window when i check checkbox and click on button.how i solve this.

    Thanks in Advance,saffu

  2. #2
    Join Date
    Mar 2011
    Posts
    65
    First of all, your label needs an ID, say "docid".

    Second, you'll get the contents like this: var content = $("#docid").html();

    Third, the whole function checking if checkbox is checked:

    Code:
    function myPopup()
    {
      var content = $("#docid").html();
    
       if($('#chk1').is(':checked'))
           alert(content);
    }

  3. #3
    Join Date
    Oct 2011
    Location
    INDIA
    Posts
    5
    thanks for replying . i am new to this i have two page .when one is parent and another is pop up when i click on parent page check box and button the corresponding value "Word File.doc" should be displayed in pop up window.it is based on html and javascript . your help will be appreciated .once again thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles