Now I get the same white page, with the “OK” button, but below it there is my message! in a Yellow box.Īnd same as before, If I press the “OK” button I will get redirected correctly to the previous view where I can add the missing fields!įirst of all, I would like to have the yellow box error message displayed in the SAME place as my form, so no new white page loading with the OK button, but just a error message somewhere inside my form when I try to save without all required fields. When I don’t fill the required fields and try to save, an empty page will load in the same window, with just an “OK” button in the middle of it, if the button is pressed, I will get back to my form application where I can fill the required fields. Sc_error_message(“Error: every required field must be filled”) If I just put in the if () condition this: I implemented this check, but there is a small issue.Įverything works, the insert doesn’t execture if all required fields aren’t filled, but the sc_error_message is acting strange. $sql_insert = "INSERT INTO dbo.TblItem(ItemTyp, ItemName, ItemBeschreibung, ItemProduktID, ItemKundeID, ItemMitarbeiterID) VALUES ( ').Īnd if not all required fields are populated, run sc_error_message() instead of the SQL insert. I tried creating a button as php, and adding this code:
SCRIPTCASE SC EXIT FORM CODE
So to avoid all these extra steps, how can I code that custom button to Save as the default button, but then redirect to my other form? The other form takes only one parameter as input, which is the “recordID”, the one that gets autoassigned when creating a new record. Usually what I would do is, add a new record, go to my Grid, see the new record and click on it (each record has a field link so you can click on it), after clicking I would get redirected to the second form (record_details) where I show some details about the record. What this button should do, once the form for the new record is filled, instead of just using the default Save button, I want another button that does the same, it saves this record, but then, it redirects to another form, where I can add more details for this record. I have an issue where I create a php Button for this form, called “Save and view details”. Up to here everything works, I can save the record and it will show in the Grid application. The PK field is not displayed (recordID), because it’s autoincrement, so whenever you add a new record, it will auto assign an ID. scexit(ref) Doesn't display the window with an OK button refresh data and returns to the current application. scexit(sel) Doesn’t display the window with an OK button and returns to the current application, repeat the application select. Note that if we wanted to exit the script completely then we would use the. I have a form that opens in a modal, and here you can add a new record. scexit(ok) Displays a window with an OK button adn returns to the previous application. The case line itself is always of the same format, and it means that we are.