benmajor
04-19-2007, 09:44 PM
Sorry if this question has already been asked before, but I really am a n00b when it comes to coding with JavaScript.
What I am looking to do is pass on the current value of a field into a pop-up window. The value needs to be written into a PHP variable. How I do this does not really matter. The method I have used thus far is as follows:
<input class="mainField" name="to" type="text" id="to" size="50" />
<script type="text/javascript" language="JavaScript">
var value = document.compose.to.value
</script>
<input name="button" type="button" class="btn" onclick="window.open('userSearch.php?field=to&value=+value','_search','width=400,height=200,left=100,top=100,resizable')" value="Find Users" />
What I am basically looking for is a really short script that takes the current value from the field named "to" and passes it to the opened window. I wondered whether it was possible to write a JavaScript variable to a PHP variable, for example:
$value = ?><script language="JavaScript">var value = "document.compose.to.value";
document.write(value);
</script>
<?php ;?>
Any help with this problem really would be gratefully received.
Many thanks in advance,
Ben
What I am looking to do is pass on the current value of a field into a pop-up window. The value needs to be written into a PHP variable. How I do this does not really matter. The method I have used thus far is as follows:
<input class="mainField" name="to" type="text" id="to" size="50" />
<script type="text/javascript" language="JavaScript">
var value = document.compose.to.value
</script>
<input name="button" type="button" class="btn" onclick="window.open('userSearch.php?field=to&value=+value','_search','width=400,height=200,left=100,top=100,resizable')" value="Find Users" />
What I am basically looking for is a really short script that takes the current value from the field named "to" and passes it to the opened window. I wondered whether it was possible to write a JavaScript variable to a PHP variable, for example:
$value = ?><script language="JavaScript">var value = "document.compose.to.value";
document.write(value);
</script>
<?php ;?>
Any help with this problem really would be gratefully received.
Many thanks in advance,
Ben