Actually, I just did this last night with great success. Here is my code, I'm sure you can adapt it to your own. PHP was not needed, this was all done as part of the client-side validation JavaScript. Use JavaScript in the submit button's onClick to set the JavaScript variable with the value from the form field (I have a form field called "z" that is getting passed along as a GET request with the window.open href):

<script type="text/javascript" language="javascript">
<!--
function validate(myForm)
{
...a bunch of other unrelated stuff here...
window.open('http://www.mysite.com/tool.php?z='+ myForm.z.value+'&loc='+location.href,'','toolbar=0,location=0,directorie s=0,status=0,me nubar=0,scrollbars=0,resizable=yes,height=400,width=400',true);
}
//-->
</script>


<form name="myForm">
<input name="z" type="text">
<input type="submit" value="Submit" onClick="return validate(myForm);">
</form>

Hope this helps.  :)


- Brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to