This topic is locked

Add and save at the same time

5/11/2017 8:20:24 AM
PHPRunner General questions
R
ruud author

I would ALSO like to save a record after clicking on the Add button. (so Add and Save directly)
Now I click Add and after that I click Save.
In some cases clicking Add and Saving at the same time is convenient.
Someone has a suggestion?
Thanks Ruud

Sergey Kornilov admin 5/11/2017

Without a screenshot it makes zero sense.

R
ruud author 5/12/2017



Without a screenshot it makes zero sense.


Sorry.


Image

Sergey Kornilov admin 5/13/2017

Are you saying it should save an empty record?

R
ruud author 5/14/2017



Are you saying it should save an empty record?



No.

Click Add. A new record is then added with the date of today automatically and then it should be saved without having to click on save.

lefty 5/14/2017



No.

Click Add. A new record is then added with the date of today automatically and then it should be saved without having to click on save.



Dosen't make much sense . But I think you want today's date to fill automatically before you hit save.
Change your date field to readonly . And enter now("%m/%d/%y") as your default value.

R
ruud author 5/15/2017



Dosen't make much sense . But I think you want today's date to fill automatically before you hit save.
Change your date field to readonly . And enter now("%m/%d/%y") as your default value.


Check the video?
Video@: https://greenapp.nl/addandsave/AddAndSave.mp4
Sorry for the inconvenience.
Regards Ruud Wiering

jadachDevClub member 5/15/2017

Why not just add a custom button to insert a record with today's date into your table and reload in client after?

romaldus 5/15/2017

Of course it is possible using custom code in phprunner "add page before process" event.

But the question is: What if a user cancel the add form and back to list page? There will be many empty fields in your table.

jadachDevClub member 5/16/2017

No, not an event, a custom button. See here : https://xlinesoft.com/phprunner/docs/inserting_button.htm

Sergey Kornilov admin 5/16/2017

I was thinking about using a custom button for this purpose too. Insert a record manually and reload the page.
Server event for MySQL:

CustomQuery("insert into mytable (DateField) values (now())");
R
ruud author 5/30/2017



No, not an event, a custom button. See here : https://xlinesoft.com/phprunner/docs/inserting_button.htm


Thank you for your input!