Results 1 to 10 of 10

Thread: Field validation issue

  1. #1
    Join Date
    Oct 2002
    Posts
    161

    Field validation issue

    There is a problem with the retention of data when you use field validation and one of those fields fail. I include the command I use for my field validation.

    The scenario goes like this, every field that does not have some type of properties is refreshed after the error is displayed, field 3,10,11,8,and 9 will loose their content after the error is displayed, so beside having to fix the field in error, in this case I have to retype whatever I had typed in fields 3,10,11,8 and 9.



    .dbEditaddFlds = "fi=0|ty=text|mask=NOTBLANK|event=both|req=true|er r=Case number mandatory,fi=1|ty=textcalendar,10,11,fi=2|ty=selec tbox+b|val=MCCID|tex=CID|oper=NB|comp=dummy|ErrorT ext=Type mandatory,3,fi=AdvAssgCase|ty=selectbox+b|val=VID| tex=VID,fi=5|ty=textcalendar,fi=office|ty=selectbo x+b|val=soid|tex=soid|oper=NB|comp=dummy|ErrorText =Intake Office mandatory,fi=agency|ty=selectbox+b|val=Aaid|tex=Aa id,fi=DefStatus|ty=selectbox+b|val=DSID|tex=DS,fi= 8,fi=9"

  2. #2
    Join Date
    Oct 2002
    Posts
    93
    Hi Andre,

    Can you demonstrate this in our online validation example? If you go to:

    http://www.aspdb.com/tornado/eg_EditUpdate.aspx

    and click Update then put in an invalid phone number and click Go, it doesn't lose the data in the form. Does it for you?

    Let us know. Thanks,
    John

  3. #3
    Join Date
    Oct 2002
    Posts
    161
    There is no problem with the fields you edit, it's the fields that you don't edit that loose data. if you look at the editflds command above, all the fields with no validation properties or date calendar properties are the ones being blanked out.

    The data is lost when the magic field validate error is displayed, see the attachment
    Attached Files Attached Files

  4. #4
    Join Date
    Oct 2002
    Posts
    93
    Hi Andre,

    Ok, I'm a little confused...

    First of all, you say that it's the fields that you don't edit that lose data. Well, in the online example shown below, even if you don't edit some of the fields and cause a validation error, NONE of the fields get wiped out.

    Secondly, there seems to be a difference between the way we're doing the validation and what you're doing. We're using the "super validator" or ASPdbValidator.jar. It does *client side* validation. This way, the fields turn red the instant an invalid keystroke is made, and a popup error message (customizable of course) pops up when they try to submit. It doesn't blank out any fields.

    Can you verify that you've got the jar file in the jars folder, etc?

    Thanks,
    John

  5. #5
    Join Date
    Oct 2002
    Posts
    161
    Hi John,

    Try this, just dont select a shipper from the dropdown and input all the other fields, you'll see they will all get blanked out after the error message is displayed.

    <script language="vb" runat="server">
    Sub Page_Load(Source as Object, E as EventArgs)
    Dim Update As New Tornado.Z()
    With Update
    .dbUnit = 777
    .dbMode = "type=grid"
    .dbSkin = 3
    .dbDSN = "nwind"
    .dbSQL = "Select * From orders"
    .dbGridDisplayFlds = "0,1,2,3,8,9,10"
    .dbTextHolder = "Test Blanking out of data"
    .dbBookMark = "orders;0"
    .dbValidatorParams = "code=/tornado/Jars|entry=false"
    .dbFilterFlds = "0,1,2,4,5"
    .dbEditaddFlds = "fi=0,fi=2,1,4,5,fi=8|ty=selectbox+b|val=CID|tex=C ID|oper=NB|comp=dummy|ErrorText=Shipper required,9,10"
    .dbNavigationItem = "basic5,search,showall,add"
    .dbCommonTables = "index=CID |sql=Select companyname from shippers order by companyname"
    .dbLookUpFlds = "fi=companyname|key=CID"
    .ASPdbNET()
    End With

    End Sub
    </script>

  6. #6
    Join Date
    Oct 2002
    Posts
    933

    Tornado - MagicValidate

    For SuperValidate (client side) the values never changed as it stays in the client side browser. For server side validation like MagicValidate the values are changed back to the original values. If update then the updated values are restored to the records origianl value. For "Add" unless there is a default, the original values are blanks. If we need to restore to thelast set of values and suppose there are defaults for all the inputs. Then which set is to restored to? Changed set or default set?

    FK

  7. #7
    Join Date
    Oct 2002
    Posts
    161
    To me, the only way that makes sence is to retain the changed values, I have never seen systems where the user has to re-input all the fields that pass edit validation because he had one field in error. Default values on add should be set on the first pass only and populate the input fields to create an initial changed set that would be used until the transaction passes all the edits.

    My add template has 42 fields, and only one of those field has a default value.

  8. #8
    Join Date
    Oct 2002
    Posts
    933
    Makes sense... but htere are 3 types of validation - default, validator and magic. I'll look into that.

    FK

  9. #9
    Join Date
    Oct 2002
    Posts
    933
    I think I luck out on this one.. turns out this 'retention' is already done in the grid edit. Obviuosely editing a grid of inputs and one magicvalidate error requires inputting the entire grid caught my attention before and code was made to retain the input. I copied the code to the standard setup and test your code and it works OK. So Supervalidate fields are not tocuhed and Magic Fields are re-populated. I'll do more checking before release.

    FK

  10. #10
    Join Date
    Oct 2002
    Posts
    933
    V2.20+ will have this implemented.

    FK

Posting Permissions

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