Friday, February 10, 2012
  Search
Support Forum
Comparing Numbers or Rounding
Last Post 25 Aug 2010 11:26 AM by Code 5. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
yeags
New Member
New Member
Send Private Message
Posts:18


--
23 Aug 2010 10:28 PM  
I have a form where the user wants to know how many hours someone has worked on a project but only in half hour increments.  I could easily create a drop down box with values like 0.5, 1.0, 1.5, etc. but that could grow painfully long and I need to account for all possible values. 

Is it possible with any of the validators or other tricks to do this check for me and only allow users to type in whole numbers or numbers that end in .5?

I have another work around in mind that is kind of weak so I thought I would check to see if there is something better I can try.

Thanks.

Running Form Master 2008 2.0.8 on DNN 4.9
Code 5
Moderator
Advanced Member
Advanced Member
Send Private Message
Posts:907


--
24 Aug 2010 01:25 AM  
Yeags,

Use a Required and a RegulaExpression validator. below is your regular expression

^\d{1,2}\.[05]$

yeags
New Member
New Member
Send Private Message
Posts:18


--
24 Aug 2010 01:46 PM  
that worked perfectly.  Thanks.  I know there is so much more I can be doing with validation and regular expressions.  I have to google that and look into it more.  do you know of any good sites for that off the top of your head?

Thanks again!
Code 5
Moderator
Advanced Member
Advanced Member
Send Private Message
Posts:907


--
25 Aug 2010 11:26 AM  
I use http://www.regexbuddy.com to help create expressions. It is a great inexpensive tool that makes me look good
You are not authorized to post a reply.

Active Forums 4.2
Copyright 2004-2012 Code 5 Systems, LLC.