radio button help please

liunx

Guest
what am I missing here?<br />
<html><br />
<head><br />
<title><br />
</title><br />
<Script Language="Javascript"><br />
<!-- Begin<br />
function sendit(){<br />
<br />
var name = BCM1.name.value;<br />
var picture = BCM1.design.value;<br />
<br />
<br />
var pic1 = new Image (100,200);<br />
pic1.src = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"aliance.jpg"<br />
al1 = pic1.src<br />
var pic2 = new Image(100,200);<br />
pic2.src = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"ABC20b.jpg"<br />
al2 = pic2.src<br />
<br />
<br />
document.write("<font size='3' face='verdana' color='#00ff00'>"+name+"</font>");<br />
document.write("<img src='http://www.htmlforums.com/archive/index.php/"+picture+"' height=100 width=100>");<br />
}<br />
//--end><br />
</script><br />
<br />
</head><br />
<br />
<body><br />
<form name="BCM1"><br />
<input type="text" name="name" size="40" maxlength="80" value=""><br />
<input type="radio" name="design" value="al1"><br />
<img src=http://www.htmlforums.com/archive/index.php/"aliance.jpg" width="100" height="100" alt=""><br><br><br />
<br />
<input type="radio" name="design" value="al2"><br />
<img src=http://www.htmlforums.com/archive/index.php/"ABC20b.jpg" width="100" height="100" alt=""><br />
<input type="submit" value="submit" onclick="javascript:sendit();"><br />
</form><br />
</body><br />
</html><br />
<br />
<br />
In this code if I place the " al1 " in place of the " picture " string or whatever it is it places the image there but if I use anything else like " picture " I just get the image sizes without the picture.So what's missing? I'm trying to load images by using radio buttons. <br />
Also when it write the new page I can click my browser back button and return but when I place document.write("<a href='http://www.htmlforums.com/archive/index.php/window.history.go(-1)'>BACK</a>"); in there I can see the link but it doesn't go back when clicked.<!--content-->Ok, I'm kinda shaky on the verbage of your posting, but here goes.<br />
<br />
If you're trying to load the image on the current page then what about using an iframe to do it:<br />
<br />
<br />
<script language="javascript"><br />
function loadPic()<br />
{<br />
picframe.location.href = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"loadPic.asp?pic=" + picName.value;<br />
}<br />
</script><br />
<body><br />
<form name=form1><br />
<input type=radio name=picName value="myPic1.jpg" onChange="loadPic();">My Pic1<br />
<input type=radio name=picName value="myPic2.jpg" onChange="loadPic();">My Pic2<br />
</form><br />
<iframe name=picFrame src=http://www.htmlforums.com/archive/index.php/loadPic.asp width="100" height="100"></iframe><br />
</body><br />
<br />
[loadPic.asp]<br />
<body><br />
<% if request("pic") <> "" then%><br />
<img width="100" height="100" src=http://www.htmlforums.com/archive/index.php/<%=request("picName")%>><br />
<%end if%><br />
</body><br />
<br />
<br />
Not sure if that's sorta what you're looking for or not, but let me know.<!--content-->
 
Back
Top