Using Javascript in Fabrik as part of Joomla

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • awharton
    New Member
    • Nov 2008
    • 2

    #1

    Using Javascript in Fabrik as part of Joomla

    I have a table which users add data into 4 fields then 5th field needs to add all these up as a sum i have done it one way but it adds them as follows

    1+12=112

    $('table_name__ _total').value = $('table_name__ _rd1').getValue () + $('table_name__ _rd2').getValue () + $('table_name__ _rd3').getValue () + $('table_name__ _rd4').getValue ();
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You need to use parseInt to convert the string into an integer.

    Comment

    • awharton
      New Member
      • Nov 2008
      • 2

      #3
      Originally posted by acoder
      You need to use parseInt to convert the string into an integer.

      Sorry for sounding dumb which i am how do i do that

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Google "parseInt":

        W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

        The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.

        The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.


        If you get stuck, post your code.

        Comment

        Working...