Save button modifications

A place for users and developers of the Xataface to discuss and receive support.

Save button modifications

Postby casanovax7 » Thu Nov 08, 2012 4:53 pm

I have been struggling with this and it might be a really easy fix. I keep having my users complain that they lose work because they forget to save. It's a very long form, but I would have thought that losing work once or twice would be enough to force them to remind themselves to save. It isn't. And so after giving her the easiest-way-to-gather-data-EVER cookie, my boss wants a glass of milk.

I would like to implement one of the following solutions, but I am really having trouble figuring out how to do even one of them:

1. Increase the size of the save button, make it red and bold, and have it at a certain fixed position at the top of the screen (so that no matter where they are in the form it is easy enough to click the save button)
2. Place a red, bold copy of the save button in each of the field groupings we have (there are 11 field groupings)
3. Automatically save the form every 60-90 seconds without refreshing the page

I have really been trying hard to figure this out. IF ANYBODY can give me some kind of help, I would really appreciate it. Thanks!
casanovax7
 
Posts: 20
Joined: Wed Sep 05, 2012 3:36 pm

Re: Save button modifications

Postby shannah » Fri Nov 09, 2012 8:57 am

The easiest solution is making the save button big and bold since you can do this with straight CSS. Doing automatic saves is possible with a little Javascript I suppose, but there are edge cases that make a "good" solution more involved. Have you considered adding an onbeforeunload handler to the window?
http://stackoverflow.com/questions/1270 ... foreunload

You could make it semi-intelligent by attaching "change" handlers to the fields on the form to set a "dirty" flag, and then only display an alert on unload if the dirty flag is set.

This is a modification that would be quite easy to implement as a module (to make it reusable), but I don't think anyone has done it yet.
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Save button modifications

Postby casanovax7 » Fri Nov 09, 2012 10:06 am

I apologize for my ignorance, but I am all turned around with this CSS. I guess I just need to figure out what code controls the look of the save button specifically... Firebug isn't helping me at all... If I could just get pointed in the right direction I'm sure I could figure most of it out. Sorry for being a bother.
casanovax7
 
Posts: 20
Joined: Wed Sep 05, 2012 3:36 pm

Re: Save button modifications

Postby casanovax7 » Fri Nov 09, 2012 10:23 am

I guess I should clarify; I know what CSS I would apply to the save button, I'm just not sure how to apply a class or id to the save button itself that will allow me to style it...
casanovax7
 
Posts: 20
Joined: Wed Sep 05, 2012 3:36 pm

Re: Save button modifications

Postby casanovax7 » Fri Nov 09, 2012 1:07 pm

I stopped thinking about it in terms of editing the Save button and finally just decided to try to create a duplicate of the save button. Added the following to the delegate class for the table:

Code: Select all
function block__before__widget(){
   echo"<input type=\"submit\" value=\"SAVE!\" name=\"--session:save\" id=\"savebutton\">";
}


And then added the following to my CSS:

Code: Select all
#savebutton {
    background-color: red;
    top: 400px;
    color: white;
    font-weight: bolder;
    left: 2%;
    margin-top: -2.5em;
    min-height: 55px;
    position: fixed;
    width: 8em;
    box-shadow: 0px 0px 10px #000;
}


That gives me a duplicate of the save button that floats on the left of the screen. Please correct me if there are any fundamental errors with doing things that way. Thanks, and keep up the great work on this TERRIFIC software!
casanovax7
 
Posts: 20
Joined: Wed Sep 05, 2012 3:36 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 6 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved