Sticky note refresh not working
Hello
I am trying to create a sticky form.
I would like to use javascript to refresh the page using drop
down selection to trigger the refresh.
The problem is I cannot get it to work. See test3.
I tried two other example that worked with a submit button and no javascript
See test 1 and test 3.
If you have any suggestions that would be great.
Note:Below you will find 3 tests I used to identify that it is the javascript
that is causing the problem.
Using Win 2003 server, Php, Apache and Mysql.
Thanks
<!-- Note: used for all test removed for this example from test 2 and test2 -->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<!-- test # 1 -->
The sticky works for this test
<?php
$test1 = $_POST['test1'];
$test2 = $_POST['test2'];
$test3 = $_POST['test3'];
?>
<script language="JavaScript" type="text/JavaScript">
<!--
-->
</script>
</head>
<body>
form action="<?php $_SERVER['PHP_SELF'];?>" name="calendar" method="POST">
<table>
<tr>
<td width="25%"><input type="text" name="test1" value="<? echo $test1; ?>"/></td>
<td width="25%"><input type="text" name="test2" value="<? echo $test2; ?>"/></td>
<td width="25%"><input type="text" name="test3" value="<? echo $test3; ?>"/></td>
<td width="25%"><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</body>
</html>
<!-- test # 2 -->
The sticky works for this test
<script language="JavaScript" type="text/JavaScript">
<!--
-->
</script>
</head>
<body>
form action="<?php $_SERVER['PHP_SELF'];?>" name="calendar" method="POST">
<table>
<tr>
<td width="25%"><input type="text" name="test1" value="<? echo $_POST['test1']?>"/></td>
<td width="25%"><input type="text" name="test2" value="<? echo $_POST['test2']?>"/></td>
<td width="25%"><input type="text" name="test3" value="<? echo $_POST['test3']?>"/></td>
<td width="25%"><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</body>
<!-- test # 3 -->
The sticky does not work for this test
<script language="JavaScript" type="text/JavaScript">
<!--
function OnChange()
{
var proId = document.getElementById('test4').value;
window.location.href="<?php $_SERVER['PHP_SELF'];?>?pro_id="+ proId;
}
-->
</script>
</head>
<body>
form action="<?php $_SERVER['PHP_SELF'];?>" name="calendar" method="POST">
<table>
<tr>
<td width="25%"><input type="text" name="test1" value="<? echo $_POST['test1']?>"/></td>
<td width="25%"><input type="text" name="test2" value="<? echo $_POST['test2']?>"/></td>
<td width="25%"><input type="text" name="test3" value="<? echo $_POST['test3']?>"/></td>
<td>
<select name="test4" id="test4" onchange="javascript:OnChange();">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>
</td>
</tr>
</table>
</form>
</body>