Results 1 to 12 of 12

Thread: Validator issue with dropdown fields

  1. #1
    Join Date
    Oct 2002
    Posts
    161

    Validator issue with dropdown fields

    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.
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2002
    Posts
    933
    Have you try the MagicValidate? Look at the last two sections of the Edit"

    * Special server side validation parameter syntax

    and

    * Example - Server MagicUpdateValidate on multiple fields

    FK

  3. #3
    Join Date
    Oct 2002
    Posts
    161
    The Example - Server MagicUpdateValidate on multiple fields
    does not show the code, only the results of the code.

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    here is the code -

    <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>

  5. #5
    Join Date
    Oct 2002
    Posts
    161
    The + between Frank and Polly should be a ~ to work.

    Thanks for the example.

  6. #6
    Join Date
    Oct 2002
    Posts
    161
    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.

  7. #7
    Join Date
    Oct 2002
    Posts
    933
    Correct, it need a dummy field to get into the filter like ->

    fi=3 | oper=NB| Comp=Dummy

    I'll correct that and get rid of that 'Dummy'. V02.24+ will have the fix.

    FK

  8. #8
    Join Date
    Oct 2002
    Posts
    161
    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?

  9. #9
    Join Date
    Oct 2002
    Posts
    933
    Correct - this mystery is solved. The drop fields are not registered in MagicValidate correctly - fixed.

    FK

  10. #10
    Join Date
    Oct 2002
    Posts
    161
    Thank You, Thank You, Thank you.

    When are you planning the next release? I have a few issues that have been fixed that i need to put in production.

  11. #11
    Join Date
    Oct 2002
    Posts
    933
    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 !!!

    FK

  12. #12
    Join Date
    Oct 2002
    Posts
    161
    You're welcome.

    Just send it anytime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •