Re: [PHP] Dirty Button
tedd tedd.sperl...@gmail.com wrote in message news:p06240802c5a28dd01...@[192.168.1.101]... At 3:41 PM -0600 1/25/09, Micah Gersten wrote: tedd wrote: At 7:02 PM + 1/25/09, Ashley Sheridan wrote: Tedd, what about having it reset if you then go back and select the original option without submitting, i.e. you originally selected and submitted on A, then selected B, then selected A again? That's a good idea. Now I just have to figure out how to make it all-encompassing enough to handle one, or more, selection-control and compare current values with the values that were previously selected. Oh, the holes we dig for ourselves. :-) Cheers, tedd What about an onChange javascript function that checks all the boxes that need input. Call it whenever any of the inputs change and in the onSubmit for the form, check it again. I currently use onClick for the select control and that works well enough. It's not the trigger that's the issue. If I decide to do that, then I have to loop through all the tag ID's, get the current values, and check them against what was presented. This just requires some thinking and I'm about all thought-out for the moment -- the end of another 12 hour day. Thanks for your input. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Getting the previously sellected is easy. When php renders the page have them inserted as javascript vars. Why not use an on change event that checks the value selected against the orig, and then depending on the selection starts a timer, say 5 - 15 sec. If the user does nothing else on any of the controls just resubmit for them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dirty Button
I like the idea of not updating the content straight away (as the user might not want to see it updated), but depending on the situation I would personally make the submit button look grey and inactive unless they've changed something in which case it'll be normal and (black). Although actually making it inactive could be bad as the javascript might not correctly update it's status to active, preventing the customer from actually submitting the data they've just painstakingly entered. The whole progressive enhancement/graceful degradation thing. However, on the other hand to having it not automatically update, the thing that I hate the most on a website is when it looses valid data that I've entered (clicked, selected, whatever), which is where saving the current state using Ajax can be useful, although probably over the top for most things anyway. Ohh btw Tedd, the problem with your implementation is that as a user, if I change some settings, but want them back, when I set it back to say C 5 as I had it before, the button is still Red, and I could get confuzled about what I'd previously entered. Obviously having a reset button would fix that, (as long as it set the submit text back to normal), or you could get PHP to set the javascript to check if the values are as they were before and set the button back. Obviously a lot more javascript than the 3 lines of code you've got there, for only a minor usability point, especially if the users previous selection is listed next to the actual buttons, but it's at least something to be aware of. My 2c. Michael Kubler *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz Nitsan Bin-Nun wrote: Since you are using JS why not just update the content straight away? (ajax/etc) On Sun, Jan 25, 2009 at 7:55 PM, tedd tedd.sperl...@gmail.com wrote: Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Cheers, tedd --- http://sperling.com http://ancientstones.com http://earthstones.com
Re: [PHP] Dirty Button
On Mon, Jan 26, 2009 at 2:05 PM, Michael Kubler greyphoenixproducti...@gmail.com wrote: I like the idea of not updating the content straight away (as the user might not want to see it updated), but depending on the situation I would personally make the submit button look grey and inactive unless they've changed something in which case it'll be normal and (black). Although actually making it inactive could be bad as the javascript might not correctly update it's status to active, preventing the customer from actually submitting the data they've just painstakingly entered. The whole progressive enhancement/graceful degradation thing. However, on the other hand to having it not automatically update, the thing that I hate the most on a website is when it looses valid data that I've entered (clicked, selected, whatever), which is where saving the current state using Ajax can be useful, although probably over the top for most things anyway. Ohh btw Tedd, the problem with your implementation is that as a user, if I change some settings, but want them back, when I set it back to say C 5 as I had it before, the button is still Red, and I could get confuzled about what I'd previously entered. Obviously having a reset button would fix that, (as long as it set the submit text back to normal), or you could get PHP to set the javascript to check if the values are as they were before and set the button back. Obviously a lot more javascript than the 3 lines of code you've got there, for only a minor usability point, especially if the users previous selection is listed next to the actual buttons, but it's at least something to be aware of. My 2c. Michael Kubler *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz Nitsan Bin-Nun wrote: Since you are using JS why not just update the content straight away? (ajax/etc) On Sun, Jan 25, 2009 at 7:55 PM, tedd tedd.sperl...@gmail.com wrote: Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Cheers, tedd --- http://sperling.com http://ancientstones.com http://earthstones.com This is veering away from PHP and into JavaScript, but there are defaultValue (for text and textarea) and defaultSelected (for lists) properties available on form fields in JavaScript so you don't even have to store the previous value in variables. I'm not sure how they are as far as degrading gracefully, but they have been around for a while now and have worked for my purposes any time I've used them. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dirty Button
On Sun, 2009-01-25 at 12:55 -0500, tedd wrote: Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Dirty button is all fine and dandy, but since you're using JavaScript to update the button's CSS (or colour), then why not update the information similarly so that the information is up to date? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dirty Button
2009/1/25 tedd t...@sperling.com Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Cheers, tedd http://www.php.net/unsub.php Hey, It does not work as described, because the button will also get red if I just click the select field but does not chose anything different (using firefox...) You use Javascript? Then why not sending formular when somethings change... I think this is quite common for select-fields -eddy
Re: [PHP] Dirty Button
Since you are using JS why not just update the content straight away? (ajax/etc) On Sun, Jan 25, 2009 at 7:55 PM, tedd tedd.sperl...@gmail.com wrote: Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? 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] Dirty Button
At 1:02 PM -0500 1/25/09, Robert Cummings wrote: On Sun, 2009-01-25 at 12:55 -0500, tedd wrote: Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Dirty button is all fine and dandy, but since you're using JavaScript to update the button's CSS (or colour), then why not update the information similarly so that the information is up to date? Cheers, Rob. Rob: This is one of the reasons why I like bouncing ideas off this group. I've changed values before in real-time by using javascript, as evidenced by this: http://webbytedd.com/c/form-calc/ But somehow that didn't come to mind as I was trying to solve my Dirty-Button problem. Thanks, I will change the values on the fly and make the Dirty-Button problem moot. 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] Dirty Button
2009/1/25 tedd tedd.sperl...@gmail.com At 1:02 PM -0500 1/25/09, Robert Cummings wrote: On Sun, 2009-01-25 at 12:55 -0500, tedd wrote: Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Dirty button is all fine and dandy, but since you're using JavaScript to update the button's CSS (or colour), then why not update the information similarly so that the information is up to date? Cheers, Rob. Rob: This is one of the reasons why I like bouncing ideas off this group. I've changed values before in real-time by using javascript, as evidenced by this: http://webbytedd.com/c/form-calc/ But somehow that didn't come to mind as I was trying to solve my Dirty-Button problem. Thanks, I will change the values on the fly and make the Dirty-Button problem moot. Cheers, tedd Would be an interesting solution if you didn't used JavaScript (css + :active attribute, but I think this is not well supported by all browsers)
Re: [PHP] Dirty Button
At 1:18 PM -0500 1/25/09, tedd wrote: At 1:02 PM -0500 1/25/09, Robert Cummings wrote: Dirty button is all fine and dandy, but since you're using JavaScript to update the button's CSS (or colour), then why not update the information similarly so that the information is up to date? Cheers, Rob. Rob: Now I remember why I didn't do that. The demo I provided was a stripped down version of a problem I was trying to solve where the user's selection was tied to a trip to the server to pull data from a database. The trip to the database should be done only after the user selects ALL the control values they are interested in. True, I could use AJAX to trigger a php slave script to get the data from the dB and throw it back to the page in real time, but that might be premature depending upon what the user really wanted to do. For example, if the user selected something from two, or more, selection controls but didn't want to see the results until they were finished thereby clicked the Submit button. Otherwise, it might annoy them to have the data change with every change in the selection controls. That's the problem I faced and thus the solution I came up with was the Dirty Button. My madness makes sense to me now. 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] Dirty Button
On Sun, 2009-01-25 at 19:04 +0100, Edmund Hertle wrote: 2009/1/25 tedd t...@sperling.com Hi gang: I had a problem and solved it -- here's the write-up: http://www.webbytedd.com/b/update-select/index.php What do you think of the solution? Cheers, tedd http://www.php.net/unsub.php Hey, It does not work as described, because the button will also get red if I just click the select field but does not chose anything different (using firefox...) You use Javascript? Then why not sending formular when somethings change... I think this is quite common for select-fields -eddy Bad move to have it auto-send when the user selects something different, especially if there is a lot of content on the page. Better to use AJAX if it really needs updating, but just alerting users to the issue is good. Tedd, what about having it reset if you then go back and select the original option without submitting, i.e. you originally selected and submitted on A, then selected B, then selected A again? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dirty Button
At 7:02 PM + 1/25/09, Ashley Sheridan wrote: Tedd, what about having it reset if you then go back and select the original option without submitting, i.e. you originally selected and submitted on A, then selected B, then selected A again? That's a good idea. Now I just have to figure out how to make it all-encompassing enough to handle one, or more, selection-control and compare current values with the values that were previously selected. Oh, the holes we dig for ourselves. :-) 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] Dirty Button
On Sun, 2009-01-25 at 13:49 -0500, tedd wrote: At 1:18 PM -0500 1/25/09, tedd wrote: At 1:02 PM -0500 1/25/09, Robert Cummings wrote: Dirty button is all fine and dandy, but since you're using JavaScript to update the button's CSS (or colour), then why not update the information similarly so that the information is up to date? Cheers, Rob. Rob: Now I remember why I didn't do that. The demo I provided was a stripped down version of a problem I was trying to solve where the user's selection was tied to a trip to the server to pull data from a database. The trip to the database should be done only after the user selects ALL the control values they are interested in. True, I could use AJAX to trigger a php slave script to get the data from the dB and throw it back to the page in real time, but that might be premature depending upon what the user really wanted to do. For example, if the user selected something from two, or more, selection controls but didn't want to see the results until they were finished thereby clicked the Submit button. Otherwise, it might annoy them to have the data change with every change in the selection controls. That's the problem I faced and thus the solution I came up with was the Dirty Button. My madness makes sense to me now. Queue the ajax requests so that no more than one per 2 or 3 seconds occurs (if change has occurred) so they are not so frequent, then also perform an on-demand update when submit is hit. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dirty Button
tedd wrote: At 7:02 PM + 1/25/09, Ashley Sheridan wrote: Tedd, what about having it reset if you then go back and select the original option without submitting, i.e. you originally selected and submitted on A, then selected B, then selected A again? That's a good idea. Now I just have to figure out how to make it all-encompassing enough to handle one, or more, selection-control and compare current values with the values that were previously selected. Oh, the holes we dig for ourselves. :-) Cheers, tedd What about an onChange javascript function that checks all the boxes that need input. Call it whenever any of the inputs change and in the onSubmit for the form, check it again. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dirty Button
At 3:41 PM -0600 1/25/09, Micah Gersten wrote: tedd wrote: At 7:02 PM + 1/25/09, Ashley Sheridan wrote: Tedd, what about having it reset if you then go back and select the original option without submitting, i.e. you originally selected and submitted on A, then selected B, then selected A again? That's a good idea. Now I just have to figure out how to make it all-encompassing enough to handle one, or more, selection-control and compare current values with the values that were previously selected. Oh, the holes we dig for ourselves. :-) Cheers, tedd What about an onChange javascript function that checks all the boxes that need input. Call it whenever any of the inputs change and in the onSubmit for the form, check it again. I currently use onClick for the select control and that works well enough. It's not the trigger that's the issue. If I decide to do that, then I have to loop through all the tag ID's, get the current values, and check them against what was presented. This just requires some thinking and I'm about all thought-out for the moment -- the end of another 12 hour day. Thanks for your input. 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