Page 1 of 1
Leave field contents after save
Posted:
Sun Dec 25, 2011 6:35 am
by kedikatt
User enters a serial number in a field. Then selects items in other fields. Saves record. But then the user needs to enter new items for the same serial number. I would like to have the serial number field not clear after a record save, unless the user actually enters new data in the field.
Is there a method to select certain fields to isolate them from refreshing?
My first effort with Xataface. Not going too badly. A simple database to start.
Re: Leave field contents after save
Posted:
Tue Dec 27, 2011 6:38 am
by dmdqlett
still no one reply this issure .
Re: Leave field contents after save
Posted:
Tue Dec 27, 2011 7:21 am
by ADobkin
Are you saying that the user is updating the existing record with that same serial number, or are they creating a new record with the same serial number?
Re: Leave field contents after save
Posted:
Tue Dec 27, 2011 11:34 am
by shannah
There's a few ways to tackle this problem.
1. Use cookies and javascript to prefill the serial number field on page load.
2. Use session variables to store the last serial number then prefill on new form (using the fieldname__default() method).
3. Normalize the data structure so you don't have to repeat this over and over. E.g. just one one record for the serial number, then create a relationship to the records that are related to this main record - and add to that relationship using either the grid widget or the standard add related record form.
4. Create a custom action with a custom javascript form that works the way you want.
Since I don't know the specs of you're app I can't really say which solution would work best in your case.
Re: Leave field contents after save
Posted:
Tue Dec 27, 2011 11:38 am
by kedikatt
A new record with the same serial number. Of course it would be nicer to have one input session per serial number, but that would be a complex, big form. There is a wide variety of data to input and it is done while actively operating and observing the system that produces the data. I have droplists and checkboxes to minimize effort for all but the serial number input.
I would just like the serial number field to retain the value, till new data is actually entered via keyboard.
Re: Leave field contents after save
Posted:
Tue Dec 27, 2011 11:39 am
by kedikatt
Thanks. You replied as I was writing. I think I will try option 2.
Re: Leave field contents after save
Posted:
Tue Dec 27, 2011 1:38 pm
by kedikatt
Thanks for the answers to my questions. Obviously I am new to php and Xataface. I am an electronics tech, not an IT. I have done some programming back in the stone age, but went hardware instead.
I just started in a tech shop that maintains over 10,000 pieces of equipment. The current data base consists of thousands of raw spreadsheets filled in randomly. Primary key is the serial number.
So I decided to make a database. Open office is easy to use for a single PC database, but we want it accessible from multiple stations.
In 3 weeks I got Apache, MySql, PHP, phpMyAdmin and now Xataface set up and working. Never used any of them before.
With just the few answers the folks provided here, I now have a useable if not proper or fancy database running.
Luckily it is very basic in it's requirements.
Thanks for the great program and help.