Dirty Form Error Trapping?
19 Message(s) by 9 Author(s) originally posted in php programming
| From: Fester Bestertester |
Date: Monday, October 22, 2007
|
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic
data form with a submit
button . Unfortunately, it's still
possible for the user to enter data changes and close the window,
without
click ing the submit button, thus
losing the data.
Can someone
point me to a generic example of some
code that will
trap
and
handle this error?
| From: McKirahan |
Date: Monday, October 22, 2007
|
wrote in message
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's still
possible for the user to enter data changes and close the window,
without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
How is the user's choice of closing the window an error?
Is a "Close Window" button next to the "Submit Form" button?
| From: Jerry Stuckle |
Date: Monday, October 22, 2007
|
wrote in message:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's still
possible for the user to enter data changes and close the window,
without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
Nope. There isn'thing you can do in PHP (which is
server side) to
prevent the user from performing client-side functions such as closing a
window.
But that also shouldn't be considered an error. It should be
considered normal operation, and your script should handle it nicely.
--
==================
Remove the "x" from my email
address
Jerry Stuckle
JDS
Computer Training Corp.
jstucklex@xxxxxxxxxxx
==================
| From: Fester Bestertester |
Date: Monday, October 22, 2007
|
wrote in message:
How is the user's choice of closing the window an error?
Is a "Close Window" button next to the "Submit Form" button?
Thanks for replying. There is no Close Window button. I think it's just
a matter of making it clear to the users that this web db
app works like
any other, i.e., if you go to your bank's web site, log on, and set up a
transaction to transfer some funds, but you do not click the "Commit"
button and instead just close the window, your transaction isn't
completed. That should not be too hard to handle.
| From: Fester Bestertester |
Date: Monday, October 22, 2007
|
wrote in message:
Nope. There isn'thing you can do in PHP (which is server side) to
prevent the user from performing client-side functions such as closing a
window.
But that also shouldn't be considered an error. It should be
considered normal operation, and your script should handle it nicely.
Thanks for responding. As I stated in my other response, I suppose it's
like any other web app. If the user clicks the browser's 'x' button
before clicking the submit button, the changes are lost. That's the way
our hr web/db app works.
But, as you state, "...your script should handle it nicely." I'm not
sure, how'd this work exactly?'d it plant a
cookie and show the
user a message?
| From: The Natural Philosopher |
Date: Monday, October 22, 2007
|
wrote in message:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's still
possible for the user to enter data changes and close the window,
without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
But the
syntax is far more complex.
Another way to achieve what you want is to use JAVAscript to submit the
form any time anything changes using teh onchange function.
| From: Jerry Stuckle |
Date: Monday, October 22, 2007
|
wrote in message:
wrote in message:
Nope. There isn'thing you can do in PHP (which is server side) to
prevent the user from performing client-side functions such as closing
a window.
But that also shouldn't be considered an error. It should be
considered normal operation, and your script should handle it nicely.
Thanks for responding. As I stated in my other response, I suppose it's
like any other web app. If the user clicks the browser's 'x' button
before clicking the submit button, the changes are lost. That's the way
our hr web/db app works.
But, as you state, "...your script should handle it nicely." I'm not
sure, how'd this work exactly?'d it plant a cookie and show the
user a message?
Well, for
instance , do not put in 1/2 an update when they click the first
window, then
expect to finish the update when they click on the second
window. Wait until all the data is present, then insert it.
And do not laugh - I have seen this done before!
And like you said - just let them know if they do not finish, the data
won't be updated.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxx
==================
| From: Jerry Stuckle |
Date: Monday, October 22, 2007
|
wrote in message:
wrote in message:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's
still possible for the user to enter data changes and close the
window, without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
But the syntax is far more complex.
Another way to achieve what you want is to use JAVAscript to submit the
form any time anything changes using teh onchange function.
Terrible advice. What happens if they put in 1/2 of the data they want
to update, then have to close because they get called away?
Or, if it updates on the fly like you suggest, they update one
field and
the
system crashes, the power goes out, the internet connection drops -
whatever.
Someone trying to enter a new address comes to mind. You want all of
the changes or none of the changes.--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxx
==================
| From: The Natural Philosopher |
Date: Monday, October 22, 2007
|
wrote in message:
wrote in message:
wrote in message:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's
still possible for the user to enter data changes and close the
window, without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
But the syntax is far more complex.
Another way to achieve what you want is to use JAVAscript to submit
the form any time anything changes using teh onchange function.
Terrible advice. What happens if they put in 1/2 of the data they want
to update, then have to close because they get called away?
That depends. In some cases that is desirable behaviour, if the fields
are somewhat independent.
Oherwise an
alert box on unloading, and ask them if they want to scrap
the data they have entered..> Or, if it updates on the fly like you suggest, they update one field and
the system crashes, the power goes out, the internet connection drops -
whatever.
No problem really..it depends if the form comprises an
atomic
transaction. Lots don't.
Someone trying to enter a new address comes to mind. You want all of
the changes or none of the changes.
Dunno. Here just changing the postcode woul probably be enough ;-)
However if you want an atomic transaction, use onchange to set a
flag ,
and submit to clear it, and on unload if the flag is still set, issue
warning.
Its fairly
standard JAVAscript.
| From: Lars Eighner |
Date: Monday, October 22, 2007
|
In our last episode,
<ffik1p$n5g$1@xxxxxxxxxxx>, the lovely and talented
Fester Bestertester
broadcast on comp.lang.php:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's still
possible for the user to enter data changes and close the window,
without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
No PHP
solution is possible to this problem. PHP works server-side. It has
no way of knowing what occurs in the browser. All can ever know is what
data is posted, and if the user doesn't submit the data, PHP must know
nothing.
--
Lars Eighner
<http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 455 days to go.
What do you do when you're debranded?
| From: Jerry Stuckle |
Date: Monday, October 22, 2007
|
wrote in message:
wrote in message:
wrote in message:
wrote in message:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's
still possible for the user to enter data changes and close the
window, without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will
trap and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
But the syntax is far more complex.
Another way to achieve what you want is to use JAVAscript to submit
the form any time anything changes using teh onchange function.
Terrible advice. What happens if they put in 1/2 of the data they
want to update, then have to close because they get called away?
That depends. In some cases that is desirable behaviour, if the fields
are somewhat independent.
Oherwise an alert box on unloading, and ask them if they want to scrap
the data they have entered..
And if they have a power failure, their internet goes down, their
browser crashes... Now what do they do?
Or, if it updates on the fly like you suggest, they update one field
and the system crashes, the power goes out, the internet connection
drops - whatever.
No problem really..it depends if the form comprises an atomic
transaction. Lots don't.
True. Many don't comprise an atomic transaction. So updating only
part of the data is very bad.
Someone trying to enter a new address comes to mind. You want all of
the changes or none of the changes.
Dunno. Here just changing the postcode woul probably be enough ;-)
Is it? What happens if I enter a new street address and the system goes
down? What happens to the city, state, postal code...
However if you want an atomic transaction, use onchange to set a flag,
and submit to clear it, and on unload if the flag is still set, issue
warning.
Its fairly standard JAVAscript.
Which does you absolutely no good if you've one of the problems noted
above.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxx
==================
| From: Jeff North |
Date: Tuesday, October 23, 2007
|
On Mon, 22 Oct 2007 09:45:31 -0700, in comp.lang.php Fester
Bestertester
<whatmeworry@xxxxxxxxxxx>
wrote in message:
| Greetings,
|
| I'm an occasional php/mysql dabbler.
|
| I have a basic data form with a submit button. Unfortunately, it's still
| possible for the user to enter data changes and close the window,
| without clicking the submit button, thus losing the data.
I'd be asking why the users are doing this then find a solution.
| Can someone point me to a generic example of some code that will trap
| and handle this error?
-- -------------------------------------------------------------
jnorthau@xxxxxxxxxxx : Remove your pants to reply
-- -------------------------------------------------------------
| From: Captain Paralytic |
Date: Tuesday, October 23, 2007
|
wrote in message:
wrote in message:
> Greetings,
> I'm an occasional php/mysql dabbler.
> I have a basic data form with a submit button. Unfortunately, it's still
> possible for the user to enter data changes and close the window,
> without clicking the submit button, thus losing the data.
> Can someone point me to a generic example of some code that will trap
> and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
Some sites (
Google Groups and the
BBC Radio Player are examples), will
pop up a JAVAsript cofirmation dialogue if you try to leave the page
having already typed information in (in thecase of Google Groups), or
have selected a radio programme to listen to (in he case of the BBC
Radio Player).
| From: Jerry Stuckle |
Date: Tuesday, October 23, 2007
|
wrote in message:
wrote in message:
wrote in message:
Greetings,
I'm an occasional php/mysql dabbler.
I have a basic data form with a submit button. Unfortunately, it's still
possible for the user to enter data changes and close the window,
without clicking the submit button, thus losing the data.
Can someone point me to a generic example of some code that will trap
and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
Some sites (Google Groups and the BBC Radio Player are examples), will
pop up a JAVAsript cofirmation dialogue if you try to leave the page
having already typed information in (in thecase of Google Groups), or
have selected a radio programme to listen to (in he case of the BBC
Radio Player).
Which can be very annoying if you've JAVAscript enabled.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxx
==================
| From: Captain Paralytic |
Date: Tuesday, October 23, 2007
|
wrote in message:
wrote in message:
wrote in message:
wrote in message:
> Greetings,
> I'm an occasional php/mysql dabbler.
> I have a basic data form with a submit button. Unfortunately, it's still
> possible for the user to enter data changes and close the window,
> without clicking the submit button, thus losing the data.
> Can someone point me to a generic example of some code that will trap
> and handle this error?
Only way is via JAVAscript.
Something like "onunload submit".
> Some sites (Google Groups and the BBC Radio Player are examples), will
> pop up a JAVAsript cofirmation dialogue if you try to leave the page
> having already typed information in (in thecase of Google Groups), or
> have selected a radio programme to listen to (in he case of the BBC
> Radio Player).
Which can be very annoying if you've JAVAscript enabled.
But so can lots of warning popups on lots of applications. The good
answer is to always let the users have an
option to
switch them off.
| From: Shelly |
Date: Tuesday, October 23, 2007
|
On Mon, 22 Oct 2007 09:45:31 -0700, in comp.lang.php Fester
Bestertester <whatmeworry@xxxxxxxxxxx>
wrote in message:
| Greetings,
|
| I'm an occasional php/mysql dabbler.
|
| I have a basic data form with a submit button. Unfortunately, it's still
| possible for the user to enter data changes and close the window,
| without clicking the submit button, thus losing the data.
I'd be asking why the users are doing this then find a solution.
| Can someone point me to a generic example of some code that will trap
| and handle this error?
A "submit" button on a form has a reason for existence. There have been
MANY times that I have entered data on a form and changed my mind before
"submit"ing. I simply closed the window and all was gone! That is the
EXPECTED behavior. If a user is annoyed that this happened, then he should
learn how to use his computer! If data are to be entered whether or not he
clicks the "submit" button, then by all means get rid of that button!
Simply put, I totally disagree with the use of the word "Unfortunately".
Rather, I would've said "dammit" (or worse!) if the data had actually been
entered when I closed the window without clicking "submit".
Shelly
| From: Jeff North |
Date: Wednesday, October 24, 2007
|
On Tue, 23 Oct 2007 10:28:59 -0400, in comp.lang.php "Shelly"
<sheldonlg.news@xxxxxxxxxxx>
wrote in message:
|
| > On Mon, 22 Oct 2007 09:45:31 -0700, in comp.lang.php Fester
| > Bestertester <whatmeworry@xxxxxxxxxxx>
wrote in message:
| >
| | Greetings,
| |
| | I'm an occasional php/mysql dabbler.
| |
| | I have a basic data form with a submit button. Unfortunately, it's still
| | possible for the user to enter data changes and close the window,
| | without clicking the submit button, thus losing the data.
| >
| > I'd be asking why the users are doing this then find a solution.
| >
| | Can someone point me to a generic example of some code that will trap
| | and handle this error?
|
| A "submit" button on a form has a reason for existence. There have been
| MANY times that I have entered data on a form and changed my mind before
| "submit"ing. I simply closed the window and all was gone! That is the
| EXPECTED behavior.
I agree. We have all done that at one time or other.
| If a user is annoyed that this happened, then he should
| learn how to use his computer!
Not necessarily so. The next button could be too close to the close
button and people are accidentally clicking the close button. Making
the next button slightly bigger (an easier target)'d solve the
problem.
| If data are to be entered whether or not he
| clicks the "submit" button, then by all means get rid of that button!
|
| Simply put, I totally disagree with the use of the word "Unfortunately".
| Rather, I would've said "dammit" (or worse!) if the data had actually been
| entered when I closed the window without clicking "submit".
|
| Shelly
|
-- -------------------------------------------------------------
jnorthau@xxxxxxxxxxx : Remove your pants to reply
-- -------------------------------------------------------------
| From: Fester Bestertester |
Date: Friday, October 26, 2007
|
wrote in message:
A "submit" button on a form has a reason for existence. There have been
MANY times that I have entered data on a form and changed my mind before
"submit"ing. I simply closed the window and all was gone! That is the
EXPECTED behavior. If a user is annoyed that this happened, then he should
learn how to use his computer! If data are to be entered whether or not he
clicks the "submit" button, then by all means get rid of that button!
Simply put, I totally disagree with the use of the word "Unfortunately".
Rather, I would've said "dammit" (or worse!) if the data had actually been
entered when I closed the window without clicking "submit".
Actually this answer kind of reflects my initial reaction on hearing the
issue come up in the first place. My inclination was to ask, "so, if you
go to your bank's web site and enter all the information for a transfer
of funds from one account to another and then just click the "x" window,
do you assume the transaction went through?"
I
sort of can not blame the users though. The
functional people designed
this particular
software usage survey form in such a way that it has
dozens of fields, for dozens of possible types of software. The result
is that the user scrolls down, enters some
numbers at the
bottom of the
form, and then forgets that there's a "Submit" button back at the top.
I have remedied this by creating several new instances of the Submit
button throughout the form, so that at least one instance is always
visible, and by placing a
text reminder at the top of the form.
Hopefully that will do the trick.
| From: Norman Peelman |
Date: Saturday, October 27, 2007
|
wrote in message:
wrote in message:
A "submit" button on a form has a reason for existence. There have
been MANY times that I have entered data on a form and changed my mind
before "submit"ing. I simply closed the window and all was gone!
That is the EXPECTED behavior. If a user is annoyed that this
happened, then he should learn how to use his computer! If data are
to be entered whether or not he clicks the "submit" button, then by
all means get rid of that button!
Simply put, I totally disagree with the use of the word
"Unfortunately". Rather, I would've said "dammit" (or worse!) if the
data had actually been entered when I closed the window without
clicking "submit".
Actually this answer kind of reflects my initial reaction on hearing the
issue come up in the first place. My inclination was to ask, "so, if you
go to your bank's web site and enter all the information for a transfer
of funds from one account to another and then just click the "x" window,
do you assume the transaction went through?"
I sort of can not blame the users though. The functional people designed
this particular software usage survey form in such a way that it has
dozens of fields, for dozens of possible types of software. The result
is that the user scrolls down, enters some numbers at the bottom of the
form, and then forgets that there's a "Submit" button back at the top.
I have remedied this by creating several new instances of the Submit
button throughout the form, so that at least one instance is always
visible, and by placing a text reminder at the top of the form.
Hopefully that will do the trick. I'd put a button at the top and bottom with reminders
throughout... too many buttons and someone will think they can update
info periodically (which is still not what you want).
My opinion is this, a form is presented with anticipation of all
fields being filled in (minus non-required fields). You must
write your
script to handle the form properly to begin with. Do not update anything
until the form is submitted and you've checked all appropriate fields
have been entered (or changed). If not give them the form back with
hints on the appropriate entries (I use CSS). If a user closes their
window without subbmitting the form then assume that they didn't want
to submit the form. If you want to use cookies so a user can come back
later that's fine... just do not do any updates until the form is
submitted and verified first.
You might look at breaking the form up into smaller pieces and
feeding it to the users based on each previous part (use cookies or
sessions to track). Have your script dynamically produce the form parts
as it reacts to previous selections... no JAVAscript needed. AT the end
when all info has been gathered and verified do your stuff.
Norm
Next Message: Cookies and MediaWiki
Blogs related to Dirty Form Error Trapping?
Using PHP in addition to whatever else you are using (series 1)
There is nothing wrong with deploying something quick and
dirty as a complement service, especially if you are adding an extra component. With
PHP, I saw a need for something fast, simple, web-oriented; I wanted to add this
PHP server
...
Questions and Answers
Good internal design is indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable; is robust with sufficient
error-handling and status logging capability; and works correctly when
...
Class of 69 - www.usfarmnetwork.com
Long hair free sex videos
dirty 101 horny sophie moon video clip gallery anal amateur blonde nudes swedish girl thumbs nude, swedish pussy photos quicktime video babes blowjob Source: www.southernalliance.org healingsinging.com
...
[fm-news] Newsletter for Tuesday, April 24th 2007
About: DM Jot aims to provide a quick and
dirty way for Dungeons & Dragons Dungeon Masters (DMs) and players to keep each other in the know about their characters. DMs create campaigns, and players can then create their
...
2.6.22-rc1-mm1
-cm4000_cs-fix-
error-paths.patch -cm4000_cs-use-bitrev.patch -use-simple_read_from_buffer-in-fs.patch -use-simple_read_from_buffer-in-kernel.patch -pretend-cpuset-has-some-
form-of-hugetlb-page-reservation.patch -lib-hexdump.patch
...
[fm-news] Newsletter for Friday, May 04th 2007
Changes: Support for advanced
error handling. Support for Apache commons VFS file handling. Support for the Apache Derby database. Dimension key caching. Greatly improved job handling, with 14 new job entries to choose
...