CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163

    Client Side scripting

    Hello! I am fairly new to .NET. I am doing some client side scripting with VB script to validate user input (OnBlur). My problem is if close the page the validation script runs. I know back in VB6 I used to use somthing like If Not ActiveControl Is Text1.... then put in my code . This would keep the code from running if the user wanted to exit. Anyway to do this in my scripting code. How do I stop the code from running if the user wants out. Suggestion appreciated.

  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    You might wanna explain a little of on what type of project is this. ASP.NET? Windows App?

    -Cool Bizs

  3. #3
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163
    ASP.NET- I inherited a project which is mostly complete except for some user validations. I'm not familiar with Java scripting so I wanted to use vb script.

  4. #4
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Which event that you use to trigger the validation?

    -Cool Bizs

  5. #5
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163
    OnBlur, however, I am open for suggestions.

  6. #6
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    There are few other events that you can try out. The common one is not to validte the input until the submit button is clicked on. This way, user can fill up the form without any interruption and validation is down right when they click on the submit button.

    Another one is to use the event that indicates the value of the control has changed. For example, ONCHANGE(), which is triggered only if user changes the value of the control.

    Good Luck,
    -Cool Bizs

  7. #7
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163
    Thanks Coolbiz! I'll give it a try.

    Cubbie

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured