Forum Moderators: open
<form name="DomainSearch" method="GET" action="https://URL_of_the_Page_I_want_to_process_to" style="float: left">
<input type="hidden" name="siteid" value="23319">
<input name="DomainName" size="10"><input type=image src="images/but_m.jpg" name=Submit value=Search width="37" height="22" style="padding-top:2"></form>
Any help would be greatly appreicated.
Rather than have the javascript fire onload, rather call it from the page which opens your form. i.e. put your form in a new html document complete with <html>, <head>, <body> tags, etc. Then make it open as a pop-up. Just do a site search for 'popup'; there are many posts showing how do do that. The 'site search' button is near the top of this page.
Shawn
Does all that make sense, :-) I hope so, sometimes I can make things hard to understand.
The way I would handle it would be to call a window.open command that opens a local page in which 'onload' makes the post request for you...
<form name="form">
<input type=submit name="whatever" value="search">
</form>
function submit() {
document.form.action="URL_of_the_Page_I_want_to_process_to";
document.form.target="targetName";
document.form.submit();
return;
}
asp
Where you define my_submit_function something like this:
function my_submit_function () {
____var domain_to_find = document['DomainSearch'].elements['DomainName'].value;
____var my_uri = "https://URL_of_the_Page_I_want_to_process_to";
____my_uri += "?siteid=23319&DomainName=" + domain_to_find;
____window.open(my_uri,'a_name_for_my_window','menubar=no,toolbar=no,status=no,width=500,height=500,resizable=yes,scrollbars=yes');
}
Shawn
Not saying that your suggestion won't work as well, mind. (Although it does need some more code, because it needs to get the user input from somewhere. That 'somewhere' is the form on the origninal calling page. So you need to pass it in the calling url and then, in the receiving page, extract it and insert the values into your new form, before submitting the form using the onload event.)
With me?
Once you put in that additional code, it will work, but I just thought I'd provide an additional alternative which doesn't need the second html page and doesn't need the extra code.
Shawn
Now I understand that Shawns suggestion would go before the <head> in my page. Now my next thing I am using a graphic as the "button" to click, how would that code change to include what Shawn suggested, This is what is is currently:
<input type=image src="images/but_m.jpg" name=Submit value=Search width="37" height="22" style="padding-top:2">
i.e.
<html>
<head>
:
:
<script type="text/javascript">
function my_submit_function () {
.... etc
}
</script>
</head>
Instead of your <input> tag, do something like:
<a href="javascript:my_submit_function()"> <img src="images/but_m.jpg" alt="search" width="37" height="22" style="padding-top:2"></a>
Shawn