×

Discussion Board

Results 1 to 3 of 3

Thread: Form validation

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    10

    Lightbulb Form validation

    Hi All,

    I've a text field in a form:

    Code:
    self._iFields = [(u'Height','text',u'3.8')]
    Now how do i validate if the data entered is a number?

    Thanks

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Form validation

    In order to check if something is of a certain type, use the isinstance function. For example:

    Code:
    >>>p=1.45
    >>>print isinstance(p, int)
    False
    >>>print isinstance(p, float)
    True
    So when you save the data entered in your form, you can check if it is valid. I haven't tried it yet, but it should work and it shouldn't be too hard to do if you know exactly what your form is made of.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    10

    Re: Form validation

    Hey Thanks

Similar Threads

  1. second form not getting key events
    By krsunil in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-12-10, 10:29
  2. Form troubles
    By matdodgson in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-12-06, 10:49
  3. Weird Form behaviour on N73
    By Damo2k in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2008-02-21, 15:43
  4. problems in creating multipage form
    By A.Vogel in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-10-02, 08:16
  5. Form Validation
    By divyas in forum Mobile Java General
    Replies: 2
    Last Post: 2006-05-23, 12:06

Posting Permissions

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