Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
I've got a form page on my site that passes the contents of the form to a handling script that checks for completion of the form and that certain required items are filled out. If they're not, it displays an error message telling them that so and so item is missing, to go back and enter that information and resubmit the form. Unfortunately, for many users, when they browse back, they'll lose all the information they've entered, which is frustrating for them. I experience this in IE, but not in Firefox, but I've had reports from Firefox users that they've had this happen as well.

What I'd like to do is to open the error message results into a new browser window, leaving the form page intact (and just display the success/confirmation message there if everything is filled out).

I tried using the target attribute in the form code, but that doesn't seem to work - it seems like the handling script is overriding that. Here's what I tried:
Code
 <form action="appscript.php" target="_blank" method="post" /> 


That doesn't work, the error results still open in the same window (why, I'm not sure).

In the app handling script, I'm using code like this with a series of IF condition checks to see if a form data entry is filled in (and if it's in the right format for a few items, like e-mail address):
Code
 if($FirstName == "") {<br /><br />$html = new html;<br />$html -> send_header($pagetitle,$Cat,0,$user);<br />		<br />echo <<<UBBTPRINT<br />$tbopen<br /><tr><br /><td class="tdheader"><br />Application Error! - Missing First Name<br /></td><br /></tr><br />$tbclose<br /><br />$tbopen<br /><tr><br /><td class="lighttable"><br />	<br />	<br /><b>You did not enter a first name. Please use your browser's back button and fill out all required fields.</b><br /><br />	<br /></td><br /></tr><br />$tbclose<br /><br />UBBTPRINT;<br />  $html -> send_footer();	<br />exit;} 


How can I get these errors to spawn in a new window, leaving the form data alone in its original window? Alternatively, is there some way I can preserve the existing form data and return what's been filled out to the user on a "return to the application to fill in missing data" link or something? If so, well, how?

Sponsored Links
Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
Any thoughts on this, or even pointers to someplace discussing this sort of thing other than here?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
basically what ya want is an error page to popup? or do ya just want the eror to show up? cause IF it was me.. I would create a script that at has a

if(!$do == "ran"){
do this
}

if ($do == "ran"){
do this

}

then in the form put a hidden field called $do and then use a bunch of $_POST calls to get the data which if was never ran would be null and if ran would be something.. then test for the something to see if they entered all the somethings you wanted them to and if not it would still keep the values they did but wouldn't process the rest of the script until they entered it all

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
I want the error page to open in a new window.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay well thats a little trickier and I would probably use a javascript popup in that instance then.

Sponsored Links

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
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
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,833
Greg Hard 4,625
Top Posters(30 Days)
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)