I am breaking my brain in this situation :)
I have a form:
<form method="post" action="">
<input type="hidden" name="entered_markers"
value="<script type='text/javascript'> document.getElementById('rout_markers').value; </script>" />
<input type="submit" value="Enter the trees you saw!" />
</p>
</form>
As you can see, the entered_markers tries to pass some JavaScript variables.
When I process the request, I do this
$chosen_markers = $_POST['entered_markers'];
Then the strange part :)
if ( empty ($chosen_markers) || !isset($chosen_markers) ) {
$errors[] = 'Please click on the map to select spots where you spotted these tree. Markers: '.$chosen_markers;
} else {
// Set something to signify that things are ok
}
And I always have the result that the validation thought the input was not empty, but when I tried to use that variable $rout_markers it just has nothing in it.
Where am I going wrong here? Isn't it sort of a strange thing that is happening? :)