NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: alex.kolaric on November 09, 2010, 08:26:22 AM
-
Hi,
Is it possible to have 2 save buttons on the form, for example Save and Approve where both of them would save the changes to the record and if you click Approve some additional fields in the record would be set?
thanks,
Alex
-
To answer your first question, yes you can have 2 save buttons on a form. You can add a Save button simply by adding a button field to the form, and setting it to be a "Save" button.
But what you're wanting methinks is not a save button. You want an approve button, which does a save, and then follows it up with some more code. You'd need to experiment a bit to see the best way of doing this - perhaps when you add another save button you can tell one button from the other? I'm not sure, this isn't something I've tried.
Of course an alternative is to add a checkbox to the form, "approved", and if this is on then handle the code on save differently.
cheers
Bruce
-
Hi Bruce,
thanks for your answer. I know that there is an easy way to add save button on the form but I'm not sure if it is possible to determine which one was pressed when validating. I will give it a try and if you find out something in the meantime don't be a stranger :)
Regards,
Alex
-
I will give it a try and if you find out something in the meantime don't be a stranger :)
Regards,
Alex
Hi Alex,
Did you find a way to do this? I am in the same position and need two save buttons on the form with one of them setting a flag before saving.
Regards,
Ubaidullah Nubar.
-
For build 5.21 I have added a value
_buttontext_
which is set when the saved button is pressed.
So in your "save handling code" you can test the value of
p_web.GetValue('_buttontext_')
to see which button was pressed.
cheers
Bruce
-
Oooh this is nice, so nice. Two candies within one update :D
Regards,
Alex
-
For build 5.21 I have added a value
_buttontext_
which is set when the saved button is pressed.
Thanks, Bruce.
Now, is there a way to add buttons on the same row as the standard Save button?
Regards,
Ubaidullah Nubar.
-
For build 5.21 I have added a value
_buttontext_
which is set when the saved button is pressed.
So in your "save handling code" you can test the value of
p_web.GetValue('_buttontext_')
to see which button was pressed.
Thanks for this Bruce.
I must be missing something simple. How do I set buttontext in the first place? When I set a button type to 'save', the 'text' prompt gets disabled.
Regards,
Ubaidullah Nubar.
-
I must be missing something simple. How do I set buttontext in the first place? When I set a button type to 'save', the 'text' prompt gets disabled.
I managed to do this by setting the value of p_web.site.SaveButton.textvalue in the value:: routine for the button. I saved the existing value at the top of the routine and restored it in the end so the main Save button does not get affected.
But, there must be an easier/better way.
Regards,
Ubaidullah Nubar.