This topic is locked
[SOLVED]

 Close save if value = decrease

11/2/2020 9:26:43 AM
PHPRunner General questions
A
alghanim author

Close saving in the addition or redirection if the value is equal to such

if ($values["type_donation"] == "discount")

{

$xt->assign ("save_button", false);

}


I tried this universe, but an error popped up. Please help, even if Java code is better. Thanks everyone and greetings

Sergey Kornilov admin 11/2/2020

It sounds like a bad Google translation. What are you trying to achieve? Do you need to hide the Save button?

A
alghanim author 11/2/2020

Yes, I want to hide the save button based on a value
True, bad Google translation <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=92903&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

Sergey Kornilov admin 11/2/2020

When do you need to hide it, in which event?

A
alghanim author 11/3/2020

Thank you for your interest and response
I need this before adding a record

the event
before record is added

Sergey Kornilov admin 11/3/2020

I'm sorry, it still doesn't make much sense. If you do that in BeforeAdd event then the page will be reloaded and Save button will be shown again.
Could you explain the whole scenario?

A
alghanim author 11/5/2020

Thank you so much for your interest Sergey Kornilov found a better solution than hiding the save button this code hid the field better <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=92924&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />


var ctrlCountry = Runner.getControl(pageid, 'type_donation');



ctrlCountry.on('change', function(e) {

if (this.getValue() == 'discount') {

pageObj.hideField("amount_donation");

} else {



pageObj.showField("amount_donation");

}

});