Welcome to WebmasterWorld Guest from 54.211.136.250

Forum Moderators: open

Message Too Old, No Replies

New Window for Forms - differnt than most...

   
5:40 pm on May 18, 2003 (gmt 0)

10+ Year Member



I am trying to get the following form to open in a new window that I can define the size and now have any toolbars. I have searched the net for hours and can't seem to find one that fits my situation. Here is the code.

<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.

7:01 pm on May 18, 2003 (gmt 0)

10+ Year Member



If I believe I'm right, then in the new window, you'll have to use some javascript in an onload in the body to define your window size, and accessories.
Mac
[edit]BTW, Welcome to WebMasterWorld![/edit]
12:01 am on May 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Equivity & welcome to WebmasterWorld

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

12:28 am on May 19, 2003 (gmt 0)

10+ Year Member



Normally that would work, but the URL I am going to is a third-party site so I do not have access to there HTML. See my problem.
12:38 am on May 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure I understand you correctly... You have a form with an 'action' [URL_of_the_Page_I_want_to_process_to",...] and you want want [URL_of_the_Page_I_want_to_process_to...] (i.e. the results) to open up as a pop-up? Yes? At any rate, you don't need to make any changes to the html page that will be pop'ed up. All the code should go in the calling page.
12:53 am on May 19, 2003 (gmt 0)

10+ Year Member



This is a search form (i.e. domain name search). I have a reseller for then, when someone click the search button it processes the name they are searching for through there site and return the results on there site (using my userid number) What I want to do is when you click on the search button it open a new screen pulling there page results. I do not want the toolbars or menu bars to show up and I want to define the new window size.

Does all that make sense, :-) I hope so, sometimes I can make things hard to understand.

1:26 am on May 19, 2003 (gmt 0)

10+ Year Member



hmmm interesting problem, I see what you mean.

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

1:37 am on May 19, 2003 (gmt 0)

10+ Year Member



I am very new to this part of Jave/HTML, could you break it down a little easier for me, so I know exactly what I would need to do and how to do it, Thanks so much!
3:26 am on May 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Another way is to have your 'submit' button an <a> tag instead of an <input>. Have it do something like: <a href="javascript:my_submit_function()">

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

10:26 am on May 19, 2003 (gmt 0)

10+ Year Member



nah wouldn't work ShawnR - you've got to remember that the POST request needs to *return* the information into the popup.

Equivity, all you need to do is attached the js function I gave you to the body of your popup page, to ensure it fires on load, and submits the form for you.

asp

1:16 pm on May 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good point. But Equivity needs a GET, not a POST, if I read msg#1 correctly, so it will work.

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

2:06 pm on May 19, 2003 (gmt 0)

10+ Year Member



I am not sure which one would be best to use, or I how I would ever write the code any help with that would be AWESOME.
2:31 pm on May 19, 2003 (gmt 0)

10+ Year Member



Yeah Shawn - you're quite right sorry about that.

Equivity go with Shawn's suggestion - that's a much better method.

asp

2:54 pm on May 19, 2003 (gmt 0)

10+ Year Member



Ok - cool.

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">

3:08 pm on May 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't put it befor the <head>, put it before the end of the <head>. i.e. somewhere between <head> and </head>.

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

3:44 pm on May 19, 2003 (gmt 0)

10+ Year Member



PERFECT PERFECT PERFECT!

AWESOME IT WORKS GREAT!

THANK YOU!

One question:

Although it works do I still need the following in the ,form> tag?

action="https://www.registerapi.com/rapi/style1/Registration/Step_01/CheckDomain.asp" style="float: left">
<input type="hidden" name="siteid" value="23319">

4:15 pm on May 19, 2003 (gmt 0)

10+ Year Member



Equivity,

In the nicest possible way, we're here to help - not do your homework for you. Try it and see what happens.

asp

4:43 pm on May 19, 2003 (gmt 0)

10+ Year Member



You are right, sometime I think it woulr be easier to just ask and get an answer than to trial and error and learn something new. :-)