This topic is locked

How to change SAVE button label

9/18/2008 4:47:53 AM
PHPRunner General questions
L
Lisa2006 author

Hi Forum,
On an Add page I would like to change the description button "Save" to something like "Proceed" based on an IF condition on the Add Page | Before record added event.

Is this possible and if so how?
Thanks in advance
Lisa

J
Jane 9/18/2008

Hi,
I'm not sure that I understand you correctly.

Add Page: Before record added event occurs before new data is written to the database, but after Save button was pushed.

L
Lisa2006 author 9/18/2008

Hi,

I'm not sure that I understand you correctly.

Add Page: Before record added event occurs before new data is written to the database, but after Save button was pushed.


Hi Jane,
Let me clarify...
User goes to webpage_add.php.

User enter required information.

User clicks the 'Save' button.
Upon clicking the 'Save' button an IF condition checks a particular value. Upon the resulting value the 'Save' buttion at the bottom of the add page (i.e. Save Reset Back to list) needs to change to 'Proceed'. Note, the record is NOT added at this point. Its at this point that i need a way to change the button wording from 'Save' to 'Proceed'
The user remains at the webpage_add.php and is displayed a confirmation message.
User now clicks on the new created 'Proceed' button and all data is saved.
In short, i'm trying to create a way to allow the user to confirm that the information entered is correct via a 2 stage process. I do not want to allow the user to edit there record via the EDIT event. I simply want the user to have a way to edit any information on the add.php page, even if they accidentially clicked the 'Save' button the first time round. Naturally, when the user clicks the newly created 'Procced' button on the 2nd time then the record is saved.
Another angle:

forgetting the above, what code can i put in the Add Page | Before record added event to change the button wording 'Save' to 'Proceed'.
Hope this helps and look forward to your response.
Lisa

L
Lisa2006 author 9/19/2008



Hi Jane,
Let me clarify...
User goes to webpage_add.php.

User enter required information.

User clicks the 'Save' button.
Upon clicking the 'Save' button an IF condition checks a particular value. Upon the resulting value the 'Save' buttion at the bottom of the add page (i.e. Save Reset Back to list) needs to change to 'Proceed'. Note, the record is NOT added at this point. Its at this point that i need a way to change the button wording from 'Save' to 'Proceed'
The user remains at the webpage_add.php and is displayed a confirmation message.
User now clicks on the new created 'Proceed' button and all data is saved.
In short, i'm trying to create a way to allow the user to confirm that the information entered is correct via a 2 stage process. I do not want to allow the user to edit there record via the EDIT event. I simply want the user to have a way to edit any information on the add.php page, even if they accidentially clicked the 'Save' button the first time round. Naturally, when the user clicks the newly created 'Procced' button on the 2nd time then the record is saved.
Another angle:

forgetting the above, what code can i put in the Add Page | Before record added event to change the button wording 'Save' to 'Proceed'.
Hope this helps and look forward to your response.
Lisa


Can anyone help to provide a solution.
Thanks in advance
Lisa

Sergey Kornilov admin 9/19/2008

Lisa,
there is a flaw in the logic you trying to implement.
BeforeAdd event happens on the server side, right before data is saved in the database. Once this event is processed Add page is reloaded which means you cannot change button label.
The only event that happens before page is displayed is BeforeProcess.
I recommend to check the following article that explains when each event happens and how you can use them:

http://www.xlinesoft.com/phprunner/docs/pa...le_overview.htm