I have a dillemma, I am trying to validate dropdown fields in the update template on the right.
I understand that masks cannot be applied to dropdown fields, so how can I validate that they are entered since they only appear in the update template and not in the grid, all the information that is pertinent to the user in in blue on the left, some of the information that they have to capture is for statistical reporting and is not of importance to the every day user, hence it is not displayed in the grid.
Those fields are mandatory and I cannot use a default, if they dont select one.
For other mandatory fields that are also dropdowns, I have used magiccells, but to display the error you have to include those fields in the grid, which is very restrictive if you don't need to show that data, and also a magiccell validates after the update, which defeats the purpose of validating input data before it is posted.
In my opinion we need to be able to validate dropdown fields before the update takes places, for my purpose, a dropdown fields eliminates the need for the user to type long descriptions, and I should still have the ability to validate that they did select one since I cannot default to one.
I need to keep statistics on 6 different grants, and I cannot default to any one of them.
We cannot assume that every dropdown field will have a default and if they dont select one, we can default to one.
Hope you can help on this.
PS I've attached a screen print (zip PDF) to give you an idea of what I mean.
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim MU As New Tornado.Z()
MU.dbQP = "DSN=nwind| Skin=3| Bookmark=Employees;0| startup=editupdate| TextHolder=EditTitle=Quick Edit with MagicUpdateValidate"
MU.dbEditUpdateFlds = "(;,~)fi=0|ty=RONOUPDATE, fi=1 | oper=EQ| Comp=Kwong, fi=FirstName | oper=ST | Comp=Frank+Polly | Notes=Must be Frank or Polly, fi=3 | oper=NB, fi=HireDate | oper=RAD| Comp=1/1/80-1/1/2000| Help=edit-helpfile.htm;350;250;200;200"
MU.ASPdbNET()
End Sub
</script>
In the example, I presume that having an operator of NB on the title field means that it cannot be blank, this does not seem to work, I can update the record with blanks in the title.
I've tried and cannot get Magic update to work with dropdowns fields, I've set a value of "na" in the table to test and added this code
.dbEditUpdateFlds "fi=1,fi=10,fi=11|,fi=2|ty=selectbox|val=MCCID|tex =MCCID|oper=EQ|comp=na,fi=3"
and regarless of what selection I use it will always give me the magic validate error. Adding the same code on a non dropdown field works fine.
I'm getting real frustated with dropdown fields and not being able to validate the user choice. It seems to me that using selectbox+b and then validating that the user made a choice(ie field is mandatory and blank is not acceptable) would be a very basic edit required on update and add functions.
Why is that not supported, a dropdown field is just another text field?
I'll finish checking up the ted F7 problem and I'll send you the non-official release for you to check out. I appreciate that you are the one user that drills on the data validation with great depth. Like this little typo causing the MagicValidate DropDown to fail was not reported. When you are done then the validation should be solid !!!