You Are Here:

Community: Developer Discussion Boards

#1 Old Lightbulb Form validation - 2008-03-31, 08:12

Join Date: Mar 2008
Posts: 10
Vik The Red
Offline
Registered User
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
Reply With Quote

#2 Old Re: Form validation - 2008-03-31, 14:44

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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.
Reply With Quote

#3 Old Re: Form validation - 2008-03-31, 15:32

Join Date: Mar 2008
Posts: 10
Vik The Red
Offline
Registered User
Hey Thanks
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
second form not getting key events krsunil Symbian User Interface 3 2008-12-10 11:29
Form troubles matdodgson Symbian User Interface 2 2008-12-06 11:49
Weird Form behaviour on N73 Damo2k Mobile Java Tools & SDKs 2 2008-02-21 16:43
problems in creating multipage form A.Vogel Symbian User Interface 0 2007-10-02 09:16
Form Validation divyas Mobile Java General 2 2006-05-23 13:06

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia