Current location: Hot Scripts Forums » General Web Coding » JavaScript » How 2 Open a New Browser Window & Click a Submit Button


How 2 Open a New Browser Window & Click a Submit Button

Reply
  #1 (permalink)  
Old 12-08-06, 09:50 AM
Wildhalf Wildhalf is offline
New Member
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
How 2 Open a New Browser Window & Click a Submit Button

Hi All,

I need help Badly!!!

I am developing a site that will really take off once it's finished. I think its a great idea but am having a little trouble doing something with JavaScript...

I want to :
  1. Open a New Browser Window of a certain size. - DONE in Code Below
  2. Set Focus to this Window - DONE in Code Below
  3. Click a Submit Button on a Form that is on the Page that loads.

It's Part 3 that i can't figure out. The way i want this to work is once the user clicks the button on my main page a new browser window opens and the Submit button is automatically clicked. Oh by the way i cannot edit the content of the page that is opened.

Details of Form:
  1. Form Name : ADD
  2. Input : <input type="submit" value="Add">

Code:
<html>
<body >
<CENTER>
<FORM>
<input type="button" VALUE="click me!" onClick="AddFriends()">
</FORM>
</CENTER>

<script language="JavaScript">
function AddFriends() 
{
win1 = window.open('http://www.google.com', 'newwindow', config='height=480, width=250, left=10, top=60, toolbar=no, scrollbars=yes, resizable=yes')
win1.focus();
}
</SCRIPT>

</body>
</html>

Last edited by TwoD; 12-10-06 at 10:22 AM. Reason: Please use [code][/code] wrappers.
Reply With Quote
  #2 (permalink)  
Old 12-08-06, 10:06 AM
Shaffer Shaffer is offline
Wannabe Coder
 
Join Date: Sep 2006
Location: Israel
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
You want a form on the new window that automatically gets submitted?
Well...
You make a form on the windows content like...
Code:
<form>
<input type="text" name="CRUCIAL_NAME" />
<input type="submit" name="submit" value="Submit" />
</form>
Then, you make the new window's adress: www.yoursite.com/new_window's_name.htm?CRUCIAL_NAME=CRUCIAL_VALUE

I believe that should work.


Shaffer.
__________________
Hello from Israel!

Last edited by TwoD; 12-10-06 at 10:23 AM. Reason: [code][/code] and all that...
Reply With Quote
  #3 (permalink)  
Old 12-08-06, 11:43 AM
Wildhalf Wildhalf is offline
New Member
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I don't think that will work for what i am trying to do.

All i want to do is automatically click the Submit button on the new window...

I was thinking of using the JavaScript click() Function but have never used it before and need to know th syntax....

Anyone any ideas???
Reply With Quote
  #4 (permalink)  
Old 12-08-06, 03:34 PM
Shaffer Shaffer is offline
Wannabe Coder
 
Join Date: Sep 2006
Location: Israel
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
It will work, argh. I have done this before. Just make this the URL:
www.yoursite.com/new_window's_name.htm?CRUCIAL_NAME=CRUCIAL_VALUE
With the code I have pasted above.

You don't need any magical function for this.
__________________
Hello from Israel!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
on button click, open an email client ! n3wb!e JavaScript 4 07-14-06 04:37 AM
pre-sized window from a submit button buzzby PHP 1 09-13-05 02:46 PM
New Window with Submit Button phppick JavaScript 0 07-18-05 04:51 AM
Open new window using Javascript! qt4eva JavaScript 1 04-20-05 01:41 PM
would you please help me loading a submit button without click on it kicon HTML/XHTML/XML 1 12-23-04 09:58 AM


All times are GMT -5. The time now is 11:21 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.