Welcome to Dream.In.Code
Become an Expert!

Join 149,987 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,376 people online right now. Registration is fast and FREE... Join Now!




Running a PopWindow within a Form Field using Post Method

 
Reply to this topicStart new topic

Running a PopWindow within a Form Field using Post Method, Prevent the original page from refreshing until its submit button is h

BustAGut
19 Nov, 2006 - 05:11 PM
Post #1

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 17


My Contributions
What I have - and I thought this was clever but ... is a form that has several
fields which I was planning on using the post method to run RespondToAddSkillPoints.asp
that actually does the DB update. The clever part ... or so I thought was the submit button
within the form that pops up a separate window (and runs popgeneral.asp) that access the DB
and provides a way to fill in one of the fields within the form. (This gets around the limitations
of combo boxes and works great until I changed the method of the form to POST at which time
when I hit the popup window is now casusing and the base page to refresh with an error.

Any ideas on keep the original page from changing while I fill in the form field before
I hit the form submit action button?

Thanks

CODE

        <form name="test1" action="RespondToAddSkillPoints.asp" method=post>
          <p>Week: <input type="text" name="T_week" size="6">  <br>
          PlayerID: <input type="text" name="T_PlayerID" size="8">
          <input type="submit" value="Select" name="btn" onclick="popgeneral('test1.T_PlayerID', 'SELECT Players.PlayerID, Players.First, Players.Last, Players.fldUsername FROM Players ORDER BY Players.fldUsername;', 'PlayerID')"><br>
          Skill Points: <input type="text" name="T_SP" size="10"><br>
          <input type="submit" value="Submit" name="B1">
          <input type="reset" value="Reset" name="B2"></p>
        </form>

User is offlineProfile CardPM
+Quote Post

BustAGut
RE: Running A PopWindow Within A Form Field Using Post Method
19 Nov, 2006 - 08:28 PM
Post #2

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 17


My Contributions
Interesting I guess I need to read up on this but the fix for those who want to know required the
addion of the following
CODE
onsubmit="return(false);"
tag!

CODE

<form name="test1" action="RespondToAddSkillPoints.asp" method=post onsubmit="return(false);">


I love this stuff!
User is offlineProfile CardPM
+Quote Post

BustAGut
RE: Running A PopWindow Within A Form Field Using Post Method
20 Nov, 2006 - 04:51 PM
Post #3

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 17


My Contributions
mad.gif

I spoke to soon the onsubmit="return(false);" while keeping my original page from trying to regenerate
during the internal sumbit is preventing the form post method from executing correctly. I'll have to
keep trying ... maybe a nested form will work?

I'll keep hacking away but if someone has a solution I'll be glad for the advice!

Thanks agian.
User is offlineProfile CardPM
+Quote Post

folen
RE: Running A PopWindow Within A Form Field Using Post Method
28 Nov, 2006 - 01:48 AM
Post #4

New D.I.C Head
*

Joined: 7 Mar, 2002
Posts: 47

if i get u rigth:
u want to use the postback but not to refresh anything
what u need to do is enable viewstate for the controls that u want to keep from refreshing and in your code to check if this is postback or not (to prevent the error that u talked about)
do
if(IsPostBack)
{
// it's a postback ,do what u have to do
}
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 07:43PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month