poetnabotl Posted May 16, 2008 Share Posted May 16, 2008 I have a field (classSelect) from which the user selects a drop-down value. Then I have a button that sets a variable to that value, goes and creates another record, does other hoobledee ha, comes back to the first record, clears the drop-down field. Is there a way to validate said field only when the user tries to leave that record? I'd like it so that when a user tries to leave the record the database checks to see if the "classSelect" field is empty and, if it's not, a dialog says "whoa there, bucko! there's data in that field when there shouldn't be!" The problem with my current validation setup is that it validates the field when the button's script is run. So before the button can set the variable to studentTable::classSelect the "whoa there, bucko!" dialog box pops up. Am I going about this the wrong way? I'd appreciate any insight anyone has. Jason. Link to comment Share on other sites More sharing options...
Maarten Witberg Posted May 17, 2008 Share Posted May 17, 2008 Why is it necessary for that value to be empty? How does the user navigate from record to record? Link to comment Share on other sites More sharing options...
poetnabotl Posted May 17, 2008 Author Share Posted May 17, 2008 Well, it's not strictly necessary for the field to be empty. I'm attaching a stripped down version of the file in the hopes that it'll be easier than explaining. I wonder, with the current setup, if people will think that once they've selected a class in the drop-down, that their job is done. I thought it would be a good safe-guard to warn them if they've selected a class but not pressed "enroll." And I thought a good test would be whether the drop-down was empty. Your question about how the user navigates... you thinking, if they navigate by scripted buttons (which I think they will, ultimately), to have the script check the field? Thanks a ton. Jason. Link to comment Share on other sites More sharing options...
Maarten Witberg Posted May 18, 2008 Share Posted May 18, 2008 I think you can go four ways: 1. do the scripting up front: user clicks "enroll" and a popup appears with the value list, user selects or cancels, script creates new join record 2. do a half-scripted method: user clicks "enroll" and a new empty portal row appears. then set the menu items list in the portal row for the user to select from. drawback is, there are no checks if the user leaves the portal row empty. 3. like you said, script all navigation to be able to perform the checks 4. use a script trigger plugin such as DoScript or ZippScript to trigger the script upon selecting a value. Link to comment Share on other sites More sharing options...
poetnabotl Posted May 18, 2008 Author Share Posted May 18, 2008 I appreciate the suggestions. I think I'm gonna go with the scripted buttons, mostly because it's the way I know how. I tried it earlier today and it seemed to work. I know I read something in the Missing Manual about attaching parameters to a script to test which button it's coming from, so I only have to write one script. Next is to tackle that. I appreciate the help, kjoe. Link to comment Share on other sites More sharing options...
poetnabotl Posted May 18, 2008 Author Share Posted May 18, 2008 I got that working too! Thanks to searches in these forums. I really appreciate the help, guys, both specifically to me and also to other people, whose problems and solutions I get to reference. Am I a big nerd for being excited that my DB is slowly not-sucking? Link to comment Share on other sites More sharing options...
Maarten Witberg Posted May 18, 2008 Share Posted May 18, 2008 Am I a big nerd for being excited that my DB is slowly not-sucking? heh heh. welcome to the club poetnabotl! Link to comment Share on other sites More sharing options...
Recommended Posts