Re: [PHP] Re: idiot proofing
Hello, on 06/24/2009 09:24 PM Shawn McKenzie said the following: >> What about placing the contents in different divs and showing hiding >> those divs on submit? Then using AJAX to update the server / database >> with the requested operation? >> > That's a good one, however I'm assuming you haven't been following PJ's > posts :-) Once he tries AJAX, I feel for the js.general and > ajax.general folks! Not necesssarily. You may want to try this scaffolding component that lets you create CRUD (Create, Read, Update, Delete) forms without writing a single line of Javascript, all with AJAX support, so it submits the forms to the server without page reloading. Actually this a plug-in of the Forms Generation and Validation class, that generates all the necessary Javascript transparently for you. You can compose any forms with any custom inputs, and save data to databases or any other type of storage. Take a look at this live example: http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input The main forms class and the optional plug-ins are available from here: http://www.phpclasses.org/formsgeneration -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: idiot proofing
At 6:39 AM -0500 6/25/09, Jay Blanchard wrote: [snip] ...stuff... [/snip] I had to LOL at the subject line for the potential irony :) Me too, but for a different reason -- I fear it's too late. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: idiot proofing
[snip] ...stuff... [/snip] I had to LOL at the subject line for the potential irony :) Typically we set applications to submit to central processing code for a number of reasons, maintainability being the highest among these. So you get... Form->Central Processing->Output Typically this allows us to stay within the MVC idiom and offers many benefits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: idiot proofing
[EDITED FOR MISTAKES AND TYPOS] He can even use http://www.ajaxload.info/ to create his own loading circle to hide on the page. He can hide the image's visibility by using the css property display:none and on the form submit he can do a JavaScript "document.getElementById(id).style.display = '';" , assuming he gave the object an id and make it visible. While this post might feel too instructional the fact that you joked PJ wasn't ready for AJAX made want to put in a bit more clarity. If this isn't clear enough, please let me know and I'll paste the appropriate markup and js. -Original Message- From: Michael A. Peters [mailto:mpet...@mac.com] Sent: Wednesday, June 24, 2009 10:36 PM To: Bastien Koert Cc: Shawn McKenzie; php-general@lists.php.net Subject: Re: [PHP] Re: idiot proofing Bastien Koert wrote: >>> >> That's a good one, however I'm assuming you haven't been following PJ's >> posts :-) Once he tries AJAX, I feel for the js.general and >> ajax.general folks! >> > > Well, I have followed PJ's posts and agree that this [AJAX] is > something that he's not ready for yet. Not to mention, when your site depends upon ajax, it doesn't work for those who disable scripting, so a solution that doesn't involve js really should be developed anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: idiot proofing
He can even use http://www.ajaxload.info/ to create his own loading circle to just embed the code. He can then image's visibility to the css property display:none and on the form submit he can do a JavaScript "document.getElementById(id).style.visibility = 'visible';" , assuming he gave the object an id and make it visible. While this post might feel too instructional the fact that you joked PJ wasn't ready for AJAX made want to put in a bit more clarity. If this isn't clear enough, please let me know and I'll paste the appropriate markup and js. -Original Message- From: Michael A. Peters [mailto:mpet...@mac.com] Sent: Wednesday, June 24, 2009 10:36 PM To: Bastien Koert Cc: Shawn McKenzie; php-general@lists.php.net Subject: Re: [PHP] Re: idiot proofing Bastien Koert wrote: >>> >> That's a good one, however I'm assuming you haven't been following PJ's >> posts :-) Once he tries AJAX, I feel for the js.general and >> ajax.general folks! >> > > Well, I have followed PJ's posts and agree that this [AJAX] is > something that he's not ready for yet. Not to mention, when your site depends upon ajax, it doesn't work for those who disable scripting, so a solution that doesn't involve js really should be developed anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: idiot proofing
Bastien Koert wrote: That's a good one, however I'm assuming you haven't been following PJ's posts :-) Once he tries AJAX, I feel for the js.general and ajax.general folks! Well, I have followed PJ's posts and agree that this [AJAX] is something that he's not ready for yet. Not to mention, when your site depends upon ajax, it doesn't work for those who disable scripting, so a solution that doesn't involve js really should be developed anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: idiot proofing
On Wed, Jun 24, 2009 at 8:24 PM, Shawn McKenzie wrote: > Bastien Koert wrote: >> On Wed, Jun 24, 2009 at 5:30 PM, Shawn McKenzie wrote: >>> PJ wrote: I have a bit of a situation. I have set up addBooks, editBooks and deleteBooks pages. Before complicating my life & mixing them up in one file, I am running tests. I'd like to make them idiot proof, up to a point. When the page is submitted and the code is parsed, the form inputs remain on the screen along with the submit buttons. I'm not sure of what is the normal way of closing/hiding/wiping the screen output before showing the result output of the operation. I do not want a user to resubmit the input which is still in the input $strings. I am wondering if I should be using some code to clear the inputs like unsetting??? sessions or a break or am I doing something wrong with the flow of the code? I'd like to leave the pages with only the output of success (or failure) and links to do another add/edit/delete operation. Thanks for any suggestions. >>> I've never tried it, but you can possibly submit to an intermediate page >>> that stuffs the post vars into a session, echos "please wait" and then >>> redirects to the page that does the processing. The processing page >>> gets the sessions vars and does its business. >>> >>> -- >>> Thanks! >>> -Shawn >>> http://www.spidean.com >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> >> What about placing the contents in different divs and showing hiding >> those divs on submit? Then using AJAX to update the server / database >> with the requested operation? >> > That's a good one, however I'm assuming you haven't been following PJ's > posts :-) Once he tries AJAX, I feel for the js.general and > ajax.general folks! > > -- > Thanks! > -Shawn > http://www.spidean.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Well, I have followed PJ's posts and agree that this [AJAX] is something that he's not ready for yet. @PJ, the whole submit / process/ redraw the form only takes a few seconds and the simplest thing is to just place a spinning 'buy' gif image in the center of the page to let people know something is working -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: idiot proofing
Bastien Koert wrote: > On Wed, Jun 24, 2009 at 5:30 PM, Shawn McKenzie wrote: >> PJ wrote: >>> I have a bit of a situation. >>> I have set up addBooks, editBooks and deleteBooks pages. Before >>> complicating my life & mixing them up in one file, I am running tests. >>> I'd like to make them idiot proof, up to a point. >>> When the page is submitted and the code is parsed, the form inputs >>> remain on the screen along with the submit buttons. >>> I'm not sure of what is the normal way of closing/hiding/wiping the >>> screen output before showing the result output of the operation. >>> I do not want a user to resubmit the input which is still in the input >>> $strings. >>> I am wondering if I should be using some code to clear the inputs like >>> unsetting??? sessions or a break or am I doing something wrong with the >>> flow of the code? >>> I'd like to leave the pages with only the output of success (or failure) >>> and links to do another add/edit/delete operation. >>> Thanks for any suggestions. >>> >> I've never tried it, but you can possibly submit to an intermediate page >> that stuffs the post vars into a session, echos "please wait" and then >> redirects to the page that does the processing. The processing page >> gets the sessions vars and does its business. >> >> -- >> Thanks! >> -Shawn >> http://www.spidean.com >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > What about placing the contents in different divs and showing hiding > those divs on submit? Then using AJAX to update the server / database > with the requested operation? > That's a good one, however I'm assuming you haven't been following PJ's posts :-) Once he tries AJAX, I feel for the js.general and ajax.general folks! -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: idiot proofing
On Wed, Jun 24, 2009 at 5:30 PM, Shawn McKenzie wrote: > PJ wrote: >> I have a bit of a situation. >> I have set up addBooks, editBooks and deleteBooks pages. Before >> complicating my life & mixing them up in one file, I am running tests. >> I'd like to make them idiot proof, up to a point. >> When the page is submitted and the code is parsed, the form inputs >> remain on the screen along with the submit buttons. >> I'm not sure of what is the normal way of closing/hiding/wiping the >> screen output before showing the result output of the operation. >> I do not want a user to resubmit the input which is still in the input >> $strings. >> I am wondering if I should be using some code to clear the inputs like >> unsetting??? sessions or a break or am I doing something wrong with the >> flow of the code? >> I'd like to leave the pages with only the output of success (or failure) >> and links to do another add/edit/delete operation. >> Thanks for any suggestions. >> > > I've never tried it, but you can possibly submit to an intermediate page > that stuffs the post vars into a session, echos "please wait" and then > redirects to the page that does the processing. The processing page > gets the sessions vars and does its business. > > -- > Thanks! > -Shawn > http://www.spidean.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > What about placing the contents in different divs and showing hiding those divs on submit? Then using AJAX to update the server / database with the requested operation? -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php