I have a pop up window which lists images using a form and radio buttons.
When i click a radio button, the function is called which should pass back to the parent window.
I keep getting 'undefined' as the value which means to me that the variable hasn't been set.
How do i get around this error?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
<body>
<script type="text/javascript">
<!-- Begin
function sendValue (s){
var selvalue = s.value;
//window.opener.document.getElementById('details').value = selvalue;
//window.close();
alert(selvalue);
}
// End -->
</script>
<form name="selectform">
<?php
// Define the full path to your folder from root
$path = "../../images/news/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" )
continue;
$myfile = $file;
echo '<input type="radio" name="details" value="'.$myfile.'" onClick="sendValue(this.form.details);" />'.$file.'<br />';
}
// Close
closedir($dir_handle);
?>
</form>
</body>
</html>