No announcement yet.

numbers to words

  • Filter
  • Time
  • Show
Clear All
new posts

  • numbers to words

    Some help. How can I apply this code or function to an OnChange ajax event in a sc form I will apreciate if you can help me.
    Attached Files

  • #2
    You must create a function php with that code. and then call it in event ajax onchange.


    • #3
      Thank you very much however I will apreciate if you can send me a little example in sc form using this code, because I tried but it didn't work


      • #4
        Yo can create a external libarries for that, so yo can use it in other forms. or an easy way is create in your form: Programming - PHP Methods - New Method:
        create it with name numtoletras. and paste the code of first function: from first line:
        $xarray= array(0 => "Cero",

        until the lines:
        } // ENDFOR ($xz)
        return trim($xcadena);

        in this function there is a toolbar click in f(x). and create an attribute named xcifra.
        save this function.

        Create other function named subfijo paste the code into function: $xx = trim($xx);
        $xstrlen = strlen($xx);
        if ($xstrlen == 1 || $xstrlen == 2 || $xstrlen == 3)
        $xsub = "";
        if ($xstrlen == 4 || $xstrlen == 5 || $xstrlen == 6)
        $xsub = "MIL";
        return $xsub;

        Create an attribute: in f(x) named xx

        save this function.

        now you can call first function from event ajax: {my_field} = numtoletras({my_value});


        • #5
          Thank you very much Alvagar, it works!


          • #6
            Ok............... .