locked
Validating text box controls on Windows CE RRS feed

  • Question

  • User1239191831 posted

    Someone tell me if I'm doing something wrong here...

    I have a textbox which must only contain an integer with value 0 to 999999, so I use a RangeValidator to affect this. This works fine on IE7, but on Pocket IE for Windows CE 5.0 this validator seems to be ignored and the application fails when it tries to run a SQL select that uses this control as a parameter.

    I was thinking about using passing the Val(textbox.Text) to a Session var and using this as the SELECT parameter, but thats a bit of a fudge. Is there a better solution?

    Friday, July 4, 2008 7:40 AM

All replies

  • User-757609608 posted

    hi in win CE you will not get all the support and the control properties......better to code for every thing..

    better write your own code. for validation. 

     

    Saturday, July 5, 2008 7:38 AM
  • User2037504312 posted

    try and conver the entered value into an integer between 0-9999, if it doesn't work then alert with message box and set focues to cleared textbox for them to enter again. Do all your validation on client this way because it so much easier wiht CE

    Friday, July 18, 2008 5:10 AM
  • User1239191831 posted

    Thanks for the advice all.

    In the end I coded around the issue by putting the setting the SQL Select parameter to a Session variable. This allowed me to validate the value in my VB code before moving it into the Session var. Not that elegant, but it works.

     

    if it doesn't work then alert with message box and set focues to cleared textbox for them to enter again

     Not possible, even if I use a Javascript messagebox as the postback triggers the SQL select before the msgbox will be displayed on the client.

    Friday, July 18, 2008 5:51 AM