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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window attribute sent with form

Status
Not open for further replies.

JFRobishow

Technical User
Jun 18, 2003
87
CA
Hi all,

I'm trying to get a result page to display some results in a pre-sized window that doesn't have the browser's toolbar, etc.

I know the javascript to do this with an onClick in a link and it's working well to navigate once the results page is open.

Only problem is that the first page (after submitting the form) is resized (used onLoad) but the toolbars, etc are there.

Is there anyway I can pass such attributes with the form, from the search page or something similar, so that the first page have the attributes...perhaps doing it onload?

I thought I would try a window.open in the onLoad but that resulted in an infinite loop ²blush²

Any help is appreciated, thank you!
 
can u be a bit more clear? what page to is the main window submitting? please restructure ur question...

Known is handfull, Unknown is worldfull
 
Hi,

I tried posting yesterday but the forum was down for a while. Apparently it's fixed now so I hope this will go through.

What I have is a simple forms with an input for keywords and a submit button that submit the form using GET to another page called results.asp

I want results.asp without the location, toolbars, etc. I know how to do that with Javascript but not with a form. I didn't know how to pass the parameters to results.asp using the form (if there's anyway).

What I did to get it to work is to have the form submit to a temporary page wich then opened the results page with window.open() passing the keywords also. After that the temporary page close itself.

That however cause a problem with most pop-up blocker because the page is opened from a script and not an user's action. I thought of something else though, wich I'll try later.

Instead of having a submit button on the main window, could I just have a normal button calling the function that open the page and pass the keyword?

Cheers,

JF
 
Hi again,

I tried that and it's working great
Code:
<input type=&quot;button&quot; value=&quot;Search&quot; name=&quot;Send&quot; onClick=&quot;call_result()&quot; style=&quot;font-size:11px; color:0A1F66&quot;>

It call:
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
{
 function call_result(){
  var keywords = sending.keywords.value;
  window.open('Expo/results.asp?keywords='+keywords+'&start=0' , 'resultats' , 'location=no, menubar=no, statusbar=no, toolbar=no, scrollbars=no, resizable=yes');
 }
}

Now the problem is when the user press the enter key instead of clicking on the button. It call the action of the form:
Code:
<form name=&quot;sending&quot; method=&quot;GET&quot; action=&quot;Expo/results.asp&quot; target=&quot;results&quot;>

I tried putting call_result() in the action but that didn't work...would have been too easy. So next question anyway to call the javascript that way?
 
Ok finaly figured it out:

Code:
	function call_checkkey()
	{
		if(event.keyCode == 13)
		  call_result();
		else
		  return false;
	}

In the form's textarea I have a onKeyPress that call call_checkkey()
 
well the event keyword may not work in NS...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top