Hello here is my code:
<script type="text/javascript">
function changePage()
{
selectedValue = document.forms['f1'].s1.value;
newLocation = "http://127.0.0.1:8080/PolPlan/branze.php?page="+selectedValue;
window.locatoion = newLocation;
}
</script>
<form name="f1">
<select name="s1" onChange="javascript:changePage()">
<option value="1">strona 1</option>
<option value="2">strona 2</option>
</select>
</form>
<?php
$selectedValue = $_GET['s1'];
echo $selectedValue;
?>
I get error on line:
“$selectedValue = $_GET[‘s1’];”
Error message: Notice: Undefined index: s1
Please help me with it.
Change
to
if you want to use s1 you need to submit the form