Jump to content

Database: default value based on previous value


Recommended Posts

How can I make sure that what I enter will be the default value for the next record? Disclaimer; I am not that used in web hard coding; I use a tool that will do most of the programming for me. Here are the available events to trigger the JS/PHP code. Client side = JavascriptServer side = PHP "Insert form" works with one record / one record. The tool that I am using allows the use of a grid, inline grid. What is the recommendation to have a default value based on the prevuious entry? TIA Client side%3DJS Server side%3DPHP.jpg

Link to comment
Share on other sites

I can't really comment specifically on the application that you're using to create that, whether it uses ajax, etc, but I suppose when a record gets inserted you can add that data to the session in PHP, and then when the insert form gets displayed then one option would be to send an ajax request to PHP to retrieve that data from the session and fill out the form or, more efficiently, have PHP fill that in when it creates the form (assuming PHP produces the markup for the form).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...