View Full Version : how to pass value to iframe src attribute

05-30-2010, 09:00 AM
I just stucked somewhere in js, i know its simple task but i don't know what's wrong but i believe i just need little guidance to get my result.
Here is my problem

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript">
function OfferTwo(){
var Name = document.getElementById("txtName").value;
var Email = document.getElementById("txtEmail").value;
var sUrl = document.getElementById('offer2').src;
document.getElementById('offer2').src = 'http://www.getmyname.com?info.php?dp=0&l=0&p=0&Name='+Name+'&email='+Email;

<form name="myFrom" method="get" action="">
<input name="txtName" type="text" id="txtName">
<input name="txtEmail" type="text" id="txtEmail">
<input type="radio" name="rb" value="radiobutton" onClick="OfferTwo();">
<input type="radio" name="rb" value="radiobutton">
<iframe name="offer2" id="offer2" src="" height="500px" width="100%" frameborder="0" scrolling="no">Your Browser not supporting</iframe>

what i am trying to do on radio click 'YES' option i pass the value into querystring. Till now i got sucess to pass values but now problem is that how i pass this value into iframe src element.

I tried alot did lot of googling but didn't get anything yet.

Please help me, i know its very basic thing but i didn't trace my mistake.

Thanks i n advance