Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 13th, 2006, 05:22 AM
Registered User
 
Join Date: Dec 2006
Location: Hyderabad, Andhra Pradesh, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default iframes

hi,,i got few checkboxes in an iframe,and a button on the parent form,how could i access the checkboxes of iframe upon clicking the button which is in parent form,,actually i want to select all the checkboxes by clicking the button,ur help will be highly appreciated.

Reply With Quote
  #2 (permalink)  
Old December 18th, 2006, 07:41 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
i suggest you to go with AJAX technology using than iframe,
if you want try this code,
create a page call test1.php or you also can use html page

test1.php
----------------
<script language="javascript">
<!--//
var xmlHttp
function viewpage()
{

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="test2.php"
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("divx").innerHTML=xmlHttp. responseText
}
}

function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
viewpage()

function clickchk(){
document.getElementById("chk1").checked=true
document.getElementById("chk2").checked=true
document.getElementById("chk3").checked=true
document.getElementById("chk4").checked=true
}
//-->
</script>
<div id="divx"></div><input type="button" name="btnadd" value="Click here" onclick="javascript:clickchk()">


create a page with your checkbox....
----------------test2.php----------------------

<input type="checkbox" name="chk1" id="chk1">
<input type="checkbox" name="chk1" id="chk2">
<input type="checkbox" name="chk1" id="chk3">
<input type="checkbox" name="chk1" id="chk4">



surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variables b/t iframes smys123 Javascript 1 July 2nd, 2007 04:30 PM
Using iframes to access history toddw607 ASP.NET 2.0 Basics 0 June 27th, 2007 03:51 PM
Using IFrames gobotsoup ASP.NET 2.0 Basics 7 March 9th, 2007 01:47 PM
Iframes? Thagi ASP.NET 1.x and 2.0 Application Design 0 April 7th, 2006 07:34 AM
iframes?Do you know about it? help me then nerssi Javascript 4 September 25th, 2004 10:51 AM



All times are GMT -4. The time now is 05:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.