<html>
<head>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
function view(ss)
{
if(ss.options[ss.selectedIndex].value!='')
{
var a=document.getElementById('IndustryType');
var temp=a.value;
var b='<?php echo $id; ?>';
parent.frameright.location = "http://www.web.com/webd.php?var=" + temp + "&vars=" + b;
}
}
-->
</script>
</head>
<body>
$id=$_GET('id');
$hostname = "localhost";
$username = "car";
$password = "try";
$dbid = "car";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$result=mysql_query("select * from jop where owns='$id' and chkshare='yes'");
$sel ='<tr><td align="center" bgcolor="#EBEBEB"><select name="IndustryType" language="javascript" onchange="view(this);" size="12" style="width: 300px">';
$i = 0;
while ($row = mysql_fetch_row($result)) {
	if ($i == 0) {
		$value = 'SELECTED value="' . $row[0] . '"';

	}
	else {
		$value = 'value="' . $row[0] . '"';
	}
	$sel .= '<option ' . $value . '>' . $row[1] . '</option>';
$i++;
}
$sel .= '</select></td></tr>';
print $sel;
?>
</form>
</body>
</html>

i'm having two frames.above code is first frame code.in this code i'm getting list box first value default selected.So in the second frame i need the corresponding value should come....i 'm getting output....my problem is first value alone not getting because of onchange....default i need my second frame also should load dynamically.

Recommended Answers

All 2 Replies

Well your main problem here is trying to use javascript + php natively like this with frames.

I would look to convert this to ajax as it is much more flexible. Sort of middle ground for client vs. server side.

ok.send sample code.thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.