Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting a Form Problems..

Status
Not open for further replies.

dalvin200

Programmer
Oct 10, 2000
20
GB
Hi,

I'm having problems submitting a form and passing field values..

I have a page which is displayed and has the following form

<form method=&quot;post&quot; action=&quot;name.asp&quot; name=&quot;frmMain&quot;>
<p align=&quot;center&quot;>
<input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;Y&quot;>
<input type=&quot;submit&quot; value=&quot;submit&quot;>
</p>
</form>

now this works ok, as it posts to name.asp right ?

but what i WANT to do is have name.asp open using a javascript:window.open(&quot;name.asp&quot;,null,sFeatures)

so i tried posting the form to the above javascipt:window.open.. blah blah but the hidden input field within the form never got passed through !

Is there anyway to get this passed to name.asp AND have name.asp open in a window with its specified size etc.. ?

Any help appreciated..

Thanks..
 
Try

<form method=&quot;post&quot; action=&quot;javascript:window.open(&quot;name.asp&quot;,null,sFeatures)
&quot; name=&quot;frmMain&quot;>
<p align=&quot;center&quot;>
<input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;Y&quot;>
<input type=&quot;submit&quot; value=&quot;submit&quot;>
</p>
</form>


 
hey krappleboy, i have already tried this.. if u read my thred, i said that -

&quot;so i tried posting the form to the above javascipt:window.open.. blah blah but the hidden input field within the form never got passed through !&quot;



 
i know its a bit of a mess on, but you could do this with a global.asa file

set up the global.asa file to create a session variable, called hidden, then have the form send to itself, with a variable, that either shows the form, or loads up the javascript new window.... Then on the window you can get the page to retrieve the results from the global.asa file

sorry thats all i can think of at the moment, im relatively new to asp.....
 
If all you need to do is to get that one variable to the popup window, then you could use a javascript function and pass the variable via querystring.

<script language=javascript>
popGoesTheWindow(){
var theValue = document.frmMain.name.value;
var url = 'name.asp?name=' + theValue;
var x = window.open(url,'popWindow','optionsGoHere');
}
</script>

<form method=&quot;post&quot; action=&quot;name.asp&quot; name=&quot;frmMain&quot;>
<p align=&quot;center&quot;>
<input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;Y&quot;>
<input type=&quot;button&quot; value=&quot;submit&quot; onClick=&quot;popGoesTheWindow();&quot;>
</p>
</form>

and then you'll just grab your value on name.asp using request.querystring(&quot;name&quot;)

:)
paul
penny.gif
penny.gif
 
Paul,

Thanks for that,

I had just 2 minutes ago done it that same way myself !!
i had forgotten about passing it via the querystring !!
DOH :)

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top