PDA

View Full Version : Passing value to external site form but can't get to open in new window



blackoprogue
Aug 21st, 2009, 03:46 AM
Here is my problem. I am passing varialbes to an external website to automatically fill in the form info so the user doesn't have to. What I can't figure out is how to have the results from the external site open in a new window. I've already tried putting target="_blank" but to no use. Any help would be greatly appreciated. Please be patient as I am new to HTML and Javascript. Also new to this forum site.

[CODE]
<a href="javascript:document.theForm.submit();" class="links" title="This link will redirect you to another site">2004035684</a>.
<form method="post" name="theForm" action="#####">
<input type="hidden" name="select_county" value="#####" />
<input type="hidden" name="select_profession" value="######" />
<input type="hidden" name="select_search" value="Number" checked="checked" />
<input type="hidden" name="select_criteria" value="2004035684" />
</form>
[ICODE]

SuperPhil
Aug 21st, 2009, 06:28 AM
Hmmm, i thinking that posting in the html/css thread is going to optimize you response quality.

Scriptet
Aug 21st, 2009, 02:29 PM
target is deprecated, but should work afaik.

The way to get around the deprecated method is to add rel="external" to the link, and then create a JS to control this (I think)

blackoprogue
Aug 21st, 2009, 09:27 PM
Not too good at creating Javascript yet but here is how I resolved my problem.
I just created another webpage and had my href pointed there. Then put the form information into the new webpage with some javascript I found.


<form method="post" name="theForm" action="#####?passview=1">
<input type="hidden" name="select_county" value="#####" />
<input type="hidden" name="select_profession" value="#####" />
<input type="hidden" name="select_search" value="Number" checked="checked" />
<input type="hidden" name="select_criteria" value="2004035684" />
</form>

<script type="text/javascript">
function myfunc () {
var frm = document.getElementById("theForm");
frm.submit();
}
window.onload = myfunc;
</script>