Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Forcing a client side event to output a number to 2 decimal places
Last Post 09-29-2011 09:43 AM by Josh Hickey. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Josh HickeyUser is Offline
Posts:5
Avatar

--
09-22-2011 12:13 PM
    I have 2 fields on my form that does some simple math to pass a dollar amount to an external form.

    Example:

    Field asks how many guests are attending, user puts in 3. A client side event (specifically: $(amount) = parseInt($(attendees)) * 15.00) multiplies that number and passes it to a hidden field ($amount) that gets passed as a querystring variable to the external form.

    Make sense so far?

    That client side event works perfectly, however the output doesn't have any decimal places to make it look like currency. Is there a way to force the sum of the equation to 2 decimal places (ex: 15.00)? I'm no good with code, I had to find an example of this client side event on another form and modify it for my purposes.

    If somebody could help me out i'd be very appreciative!

    Thanks.
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    09-23-2011 07:53 AM
    Hi Josh,
    In the client side event you need to properly apply a conversion to currency. Take a look at this link: http://javascript.internet.com/form...ormat.html

    What you will find is that formatCurrency(this.value) in the site would probably be something like this in your code:
    $(amount) = formatCurrency($(attendees) * 15) as my test didn't need the parseint. The thing is you will get a $ x.xx type of result when you convert to currency so you won't get a x.xx look i.e. without the leading $ sign but that is how javascript looks and that is how currency looks. Hope this helps
    Josh HickeyUser is Offline
    Posts:5
    Avatar

    --
    09-29-2011 09:43 AM
    Don,

    Your code worked as described, but the 3rd party form rejects the $ symbol that gets passed. Oh well! What I have now works, it was mostly a client nitpick that I asked.

    Thanks so much for your reply! I appreciate it.

    Josh

    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi