Topic: form submit workaround... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10583" title="Pages that link to Topic: form submit workaround... (Page 1 of 1)" rel="nofollow" >Topic: form submit workaround... <span class="small">(Page 1 of 1)</span>\

 
Drakkor
Maniac (V) Inmate

From: Seatte, Warshington, USA
Insane since: Dec 2000

posted posted 07-09-2001 05:13

I'm trying to use a poll from cutandpastescripts.com (not my idea, trust me). Anyway, it's a poll script, and when you press the 'vote' button, it goes to a results page. I'm trying to get it to open up a new window and show the results in that new window. Problem is I want to make it a windows with no scroll bars, no toolbar, etc...

What I have so far (using the onsubmit attribute in the form tag) is a new windows just like I want, but it doesn't submit the information. here is the code...

quote:
<table border="0" cellpadding="0" cellspacing="0">
<form action="#" METHOD="POST"

onsubmit="window.open('http://www.cutandpastescripts.com/cgi-bin/vote/mypoll.pl?froggy81','clone','resizable,no-scrollbars,width=500,height=300')">

<tr bgcolor="#a3bea7"><td><font class="rightcont">Frogs</td><td align=center><input type=radio name="476969794169" value="Frogs"></td></tr>

<tr><td><font class="rightcont">Snakes</td><td align=center><input type=radio name="476969794169" value="Snakes"></td></tr>

<tr bgcolor="#a3bea7"><td><font class="rightcont">Lizards</td><td align=center><input type=radio name="476969794169" value="Lizards"></td></tr>

<tr><td><font class="rightcont">Turtles/Tortoises</td><td align=center><input type=radio name="476969794169" value="Turtles/Tortoises"></td></tr>

<tr bgcolor="#a3bea7"><td><font class="rightcont">Other</td><td align=center><input type=radio name="476969794169" value="Other"></td></tr>

<tr><td align=center colspan=2><input type=submit name=button value="Vote"><br>
<font face="Arial" size="1"><a href="#" onClick="window.open('PollResults.html','clone','resizable,no-scrollbars,width=500,height=300')">View Results</a></font></td></tr>
</form>
</table>



What I need is for the form to submit the data but return the results in a new window, which is why I'm trying to get a work around. Is there any way to use the target attribute to open a window and resize it, remove the scrollbars and toolbar, etc? Any other ideas?

Here is the working page...
http://www.reptilegirl.com/newpage/index.shtml

Thanks



-It never hurts to always be right-

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 07-09-2001 22:41

Have you tried putting on onClick() event handler into the submit (vote) button it self. Use this to open the new window and display the results just like the 'view results' button, only when you vote it should submit the form data as well.

The submit button would then look like this:

<input type=submit name=button onClick="window.open('PollResults.html','clone','resizable,no-scrollbars,width=500,height=300')" value="Vote">

everybody needs a swamp bear

[This message has been edited by Dracusis (edited 07-09-2001).]

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 07-09-2001 23:29

I was just wondering as I read your code Drakkor, does using

quote:
onsubmit="window.open('http://www.cutandpastescripts.com/cgi-bin/vote/mypoll.pl?froggy81','clone','resizable,no-scrollbars,width=500,height=300')">



change what the submit button actually does? I mean, deos it change the value of 'onsubmit' which would essentially change the function of the button?

Not really sure, it was just a thought.

- Resolutions, Of All My Fruitless Searches -

Drakkor
Maniac (V) Inmate

From: Seatte, Warshington, USA
Insane since: Dec 2000

posted posted 07-10-2001 04:19

Dracusis, I did try that, unfortunatly that didn't post the data to the cgi script. It pretty much does exactly what it's doing now

Butcher... the onsubmit function just runs some javascript when the submit button is pressed (in addition to the action function). What I did was disable the action function by not putting anything in it's properties, and used the onsubmit function as well. but like I said above, it doesn't post the data.

Actually, I have an idea on how I can do this... I'll let you all know if I figure it out.



-It never hurts to always be right-

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 07-10-2001 18:43

Any luck yet?

everybody needs a swamp bear

Drakkor
Maniac (V) Inmate

From: Seatte, Warshington, USA
Insane since: Dec 2000

posted posted 07-10-2001 21:05

Nope, here was my idea...

In the form, have it point to an asp page that I will make, and use target="_blank" so that it opens in a new window.

Then have the asp page format the size and look of the window, and have a meta redirect to the poll cgi, using asp to reattach the query string. Unfortunatly the query string isn't correct, and I don't know what it should look like. Notice how it goes /mypoll.pl?froggy81 ... well, I'm not sure how to attatch the rest of the query string to that. I tried another ?, didn't work, so I tried a &, and that didn't work either. Any idea how to intercept the whole query string as it is sent to the cgi?

At this point I think I'm going to have to just make a poll from scratch, and say "screw the 3rd party crap". Probably my best bet

Thanks


-It never hurts to always be right-



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu