TOPIC:

Displaying Time 1 week 4 days ago #258236

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1111
  • Karma: 1
  • Thanks: 9
I need to enter a time from a stop watch.

Example:

1 minute:24 seconds: 3 /100th seconds. What is the best way to do this? It will be a required element and must be entered in this format mm:ss:??

Thanks

Please Log in or Create an account to join the conversation.

Displaying Time 1 week 4 days ago #258237

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5366
  • Karma: 3
  • Thanks: 383
Hi Bruce,

you want user enter time?
If yes, then you can add textfield, and make a validation for this format mm:ss

Here is the code for validation of format mm:ss.
Go to that textfield->Properties->Validation->check Custom and put:
function ff_nameoftextfield_validation(element, message)
{
    
    var pattern= /(\d{2}):(\d{2})$/;
if(pattern.test(element.value)) return '';
if (message=='') message = element.name+" faild in my test.\n"
 ff_validationFocus(element.name);
 return message;

} // ff_namoftextfield_validation
Please replace nameoftextfield with name of textfield in which you want to use this time (not title)

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Displaying Time 1 week 3 days ago #258245

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1111
  • Karma: 1
  • Thanks: 9
OK BUT I need to add the 100ths of seconds also.

Please Log in or Create an account to join the conversation.

Displaying Time 1 week 3 days ago #258246

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5366
  • Karma: 3
  • Thanks: 383
Hi,

then like this:
function ff_nameofelement_validation(element, message)
{
  var pattern = /([01][0-9]|2[0-3])\:[0-5][0-9]\:[0-9][0-9]$/;
if(pattern.test(element.value)) return '';
if (message=='') message = element.name+" faild in my test.\n"
 ff_validationFocus(element.name);
 return message;
} // ff_nameofelement_validation

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.041 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!