Previous Thread
Next Thread
Print Thread
Rate Thread
#108294 05/23/2001 4:59 PM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
hi, i'm trying to open a new browser window by clicking on an input field. but it doesnt work! do you know how i can do this by an other way?


Sponsored Links
#108295 05/23/2001 5:08 PM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
What I would suggest is that you write a function that is called by a onFocus handler or even an onChange handler. Basically what you would be saying is "when this state changes, run this function."

- DB

#108296 05/23/2001 5:20 PM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
Try this:

Put this in the head tag of your html:

Code
code:

And in your input tag, put the following:

Code
code:

or

Code
code:

Keep in mind that you can put really anything in that function call, but this is the best way to achieve the results that you are looking for.

- DB

#108297 05/23/2001 5:31 PM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
do ya think that works with a send field?

#108298 05/23/2001 6:06 PM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
I'm not sure what you mean by a send field. By default, if there is only one textfield then by hitting the enter key the form is automatically submitted (Gurus: Please correct me if I'm wrong, but I thought this was globally accepted or is it just IE?)

If you want to submit a form in this manner (which I don't suggest,) then you can put an onSubmit handler.

What is it exactly that you are trying to accomplish?

- DB

Sponsored Links
#108299 05/23/2001 6:20 PM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
i insert a poll script into my page. there are just some radio fields and one to submit. i want that it'll open a new browser window (with definied px) which shows the results of the poll. so i can write a close js into the result page instead a back buttom or some other **** ... :rolleyes:

#108300 05/23/2001 6:23 PM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
I still don't understand why, especially if you're using perl, you can't just submit the form via a button object? That would make things a lot easier on you.

- DB

#108301 05/23/2001 6:29 PM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
hmm... i never thought about this. but i dont know the code to let it open a new window. sorry, i'm not the best perl writer.

#108302 05/23/2001 6:44 PM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
Don't worry about it. That's why I'm here. Now, I can't help you with the perl, but consider this:

1) You submit a form to a cgi script.
2) The script is processed and takes the user to pageA.html.
3) IN THIS PAGE, you put the code that I listed for you above, with the one exception that you put the function call in the body tag with an onLoad instead.

Does that help?

- DB

#108303 05/23/2001 7:00 PM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
hmm... you're very kind, but i dont understand everything... you said the cgi preceeds to an other page. got it. and there it opens the new window onLoad? got it. but i'd like to stay on the page were the form for the cgi is. isnt this possible?

Sponsored Links
#108304 05/23/2001 7:13 PM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
Yes, it is. Just put a function call in your form tag using the onSubmit handler instead of the actual action attribute. Granted, you're going to have to code a little more than you normally would (had you done all of this in perl,) but it should still work just the same.

- DB

#108305 05/23/2001 7:27 PM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
could you give me a hint? i dont know how to code it frown

#108306 05/24/2001 6:21 AM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
Hmmm ... let me see what I can come up with. You know, you could always find a free poll script and modify it. That might help you out in the meantime. I can't promise anything...

- DB

#108307 05/24/2001 6:48 AM
Joined: May 2001
Posts: 33
Member
Member
Offline
Joined: May 2001
Posts: 33
yeah, this was a free poll script, but for ubb. i changed the code... now it fits into my design (it's not any more in the board). it was an old poll hack, i think for ubb 5 or so. my problem is that i cant write perl. i just can change the code frown

#108308 05/24/2001 10:15 AM
Joined: May 2000
Posts: 1,168
Member
Member
Offline
Joined: May 2000
Posts: 1,168
Ahh... well then I think it might be time for you to stop by your local bookstore.


- DB

#108309 05/24/2001 11:03 AM
Joined: Feb 1999
Posts: 1,379
cal Offline
Programmer
Programmer
Offline
Joined: Feb 1999
Posts: 1,379
umm. to make a form open in another window, put the target="" inside the
tag

Just a thought smile


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)