This topic is locked

Validation of row data for button on click

7/26/2013 2:32:29 AM
PHPRunner General questions
M
mattd1 author

Hi, I'm having trouble deciphering the way to do some "Client Before" validation. It would seem I need to use OnLoad event to position functions/set events handled by the (validation) functions. Is that right?
Can anyone provide an example - the case in the manual seems to simplistic, and I can't get it working anyway. I'm at the point where I am not sure I am using the right approach.
Thanks - further detail below, although examples welcome and I'll try to work it out! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21259&image=1&table=forumtopics' class='bbc_emoticon' alt=':unsure:' />
M
I have a button in a list page, the list page being viewed in master/detail as the detail. On click of the button, before trying server updates, I want to check the client's balance is adequate.
So, the balance field is visible in the list page row. The required amount is a total debt value in the master record, shown in the page at the top above the list.
I can't seem to find a way to refer to fields in the row or the master in the Client Before event, except by using Runner.getControl.
Having circled around a bit, I now have script in the onload event, which uses getcontrol to try to get the two fields, has a function there to validate, and which sets the "on click" event for the button to run the function.
But it doesn't work.
Can anyone provide a sample of how I might approach this?

admin 7/26/2013

Could you post a screenshot that would explain what page you talking about. It's not clear if list page in question belongs to master or to details table.
It's also not clear what sort of errors you getting.