Streaming live at 10am (PST)

Input field mask with maskMoney issue

I am trying to auto-format an input field with ID amount-unsecured to format the input as a local currency.

I am using the Mask Money jQuery plugin.

I’ve included the below scripts in the tag of the page:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.maskMoney.js" type="text/javascript"></script>

I’ve change the ID of the input field to match on webflow what is in the custom code.

I’ve then tried embedding the js script below in the “before footer” custom code section, as well as in an embed directly below the actual input field. No luck in getting it to work.

<script type="text/javascript">
$("#amount-unsecured").maskMoney({

  // The symbol to be displayed before the value entered by the user
  prefix:'R ', 

  // The suffix to be displayed after the value entered by the user(example: "1234.23 €"). 
  suffix: "",

  // Delay formatting of text field until focus leaves the field
  formatOnBlur: false,

  // Prevent users from inputing zero
  allowZero:false, 

  // Prevent users from inputing negative values
  allowNegative:true, 

  // Allow empty input values, so that when you delete the number it doesn't reset to 0.00. 
  allowEmpty: true,

  // Select text in the input on double click
  doubleClickSelection: true, 

  // Select all text in the input when the element fires the focus event. 
  selectAllOnFocus: false,

  // The thousands separator
  thousands: ' ', 

  // The decimal separator
  decimal: '.' , 

  // How many decimal places are allowed
  precision: 2, 

  // Set if the symbol will stay in the field after the user exits the field. 
  affixesStay : true, 

  // Place caret at the end of the input on focus 
  bringCaretAtEndOnFocus: true 

}); 
</script>

Any ideas what I’m doing wrong?


Here is my site Read-Only: LINK

Look for errors in your console and remove the jQuery script load since Webflow already includes it. Note: that guidelines for this category require more info than what you have provided, like Read-Only Share and a published URL.

Hey Jeff. I have shared my read only link already.

Published URL: https://www.fundinghub.webflow.io

How are you loading this (local won’t work) and on what actual page are you running this code?

Loading the script in the header (see picture).

Here is one page I am running the script on: Merchant Cash Advance | Business Finance | FundingHub

It should be executing on the first input field you see there.