I'm stuck! - I have a search form, that when data is entered and submitted, the data is sent to another page! - this works well see eg below.
http://www.nctfleetlist.co.uk/normal.php
My problem is, I have a piece of javascript called "greybox", it basically loads an external page, dimming the first page and focusing on the external - see eg below.
http://www.nctfleetlist.co.uk/div4.php
The new window can be called via either a href "rel" link or an "onclick" command.
I have tried implementing the the two together but when I use the javascript to call the new window the data from the original form is not passed over! - this is what I have so far...
example 1 - using onclick command (
http://www.nctfleetlist.co.uk/eg1.php)
Code:
<script>
GB_show(caption, url, /*optional*/ height, width, callback_fn)
</script>
<form name="form1" action="test_script.php" method="post">
<input type="text" name="var1" value="">
<input type="submit" name="submit" value="submit" onclick="return GB_show('Search', 'http://www.nctfleetlist.co.uk/test_script.php', this.href)">
</form>
example 2 - using onsubmit within the form tag (
http://www.nctfleetlist.co.uk/eg2.php)
Code:
<script>
GB_show(caption, url, /*optional*/ height, width, callback_fn)
</script>
<form name="form1" action="test_script.php" method="post" onSubmit="return GB_show('Search', 'http://www.nctfleetlist.co.uk/test_script.php', this.href)">
<input type="text" name="var1" value="">
<input type="submit" name="submit" value="submit">
</form>
example 3 - using a javascript link to submit the form, adding a "rel" tag (
http://www.nctfleetlist.co.uk/eg3.php)
Code:
<script>
GB_show(caption, url, /*optional*/ height, width, callback_fn)
</script>
<form name="form1" action="test_script.php" method="post">
<input type="text" name="var1" value="">
<a href="#" onclick="document.forms[0].submit()" rel="gb_page_center[720, 300]">Search</a>
</form>
Any help is appreciated!