Announcement

Collapse
No announcement yet.

Require decimal reject fraction

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bruce - PhosphorMedia
    replied
    Originally posted by lesliekirk View Post
    Two steps forward, one step back. It doesn't seem to be recognizing the amount in the field - as in not adding to the cart.
    Hmm, I don't see how using these types of HTML attributes could effect the underlying function of the name/value pair since they all work at the DOM level. So, its probably just not hooked into the emporium module.

    BTW: we do this without a module by simply translating the decimal value on Submit (using jQuery). I'd have to remember where the hell we did that though to get a code sample, but its basically "onSubmit, get value of x, divide/multiple/etc, assigntoCGI value...continue submitting.

    Leave a comment:


  • lesliekirk
    replied
    Woohoo. It needs the name="Quantity"

    Code:
    <input name="Quantity" type="number" id="Qtybox" step="1" min="0" placeholder="1" value="1">
    Also, if you'd like the little arrows to display all the time add this bit of CSS

    Code:
    input[type=number]::-webkit-inner-spin-button, 
    input[type=number]::-webkit-outer-spin-button {  
    
       opacity: 1;
    
    }

    Leave a comment:


  • lesliekirk
    replied
    Two steps forward, one step back. It doesn't seem to be recognizing the amount in the field - as in not adding to the cart.

    Leave a comment:


  • lesliekirk
    replied
    This has actually been fun to play with. This one increments in whole numbers and doesn't go below 0

    Code:
    <input name="number" type="number" id="Qtybox" step="1" min="0" placeholder="1" >
    This one increments in 1/10th steps and doesn't go below 0

    Code:
    <input name="number" type="number" id="Qtybox" step="0.1" min="0" placeholder="1" >



    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    Simple. Use HTML5 input type:

    <input type="number" name="number" step="any" />
    I'm getting a warning when trying to use something other than a whole number.

    Leave a comment:


  • lesliekirk
    replied
    Yup, I've already mentioned it to the store owner

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    well you know how to change that :)

    The only other way is to grab some JS to do it.

    The HTML5 methods are supported by IE10 circa browsers and up. I do not believe declared Doctype effects this (at least for IE). Give it a try since its simple.

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    Simple. Use HTML5 input type:

    <input type="number" name="number" step="any" />
    Simple, elegant, genius - except the site is still HTML 4.01 Transitional

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    Simple. Use HTML5 input type:

    <input type="number" name="number" step="any" />

    Leave a comment:


  • lesliekirk
    started a topic Require decimal reject fraction

    Require decimal reject fraction

    Store is using the EmporiumPlus Dimension Pricing module which strictly requires the use of decimals (not fractions) in the input field. On occasion, there have been customers that miss the message to use decimals. I'm thinking there might be a way to check what is (or isn't) entered in the field and popup an error message, but then, I'm not sure how to do it.
Working...
X