Input Date with auto separation using Javascript

Input Date with auto separation using Javascript

  

Hi guys 

I tried using this java script for my input date

<html>
<body>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    var x = document.createElement("INPUT");
    x.setAttribute("type", "date");
    x.setAttribute("value", "0000-0-00");
    document.body.appendChild(x);
}
</script>
</body>
</html>


but I don't know how to apply it. 

can anyone help me please.?

thankyou

-daryl tejares

Hi Daryl,

1) You can't create stuff on the fly with OutSystems. You need to put an Input widget on your Screen and give it a proper Name.

2) You could make a Web Block that has as input the Id of an Input widget. In that Web Block, have an unescaped expression with the JavaScript required, using the Id that came as input parameter.

3) Put the Web Block on your Screen, and give it the proper Input widget Id as input.

That said, have you looked at the Custom Mask component in the Forge? It's probably capable of doing what you want. It'll save you some headaches :).