-2

I want to find the value of and want to mask the first 4th of the text field to another character when the length of the text field is 4 or greater.

but I don't know well asp.net skill. help me plz.

here is some html in body tag

<body>
    <form id="form1" runat="server">
        <div>
            <input type="text" runat="server" id="input1" name="input1" value="TestText" />
            <input type="button" runat="server" class="btnCnvt" name="btnCnvt" id="btnCnvt" value="convert" onclick="GetValue()" />
        </div>
    </form>
</body>

here is javascript :(

<script type="text/javascript">
        function GetValue()
        {
              // Don't Work!!!(not fount 'value' attribute)
              var str = document.getElementById("input1").value;
        }
</script>
JuniorDev
  • 1
  • 1

1 Answers1

0

Your button is from server side, So, javascript function will not fire on OnClick event, instead use OnClientClick event.

Naing Lin Aung
  • 3,373
  • 4
  • 31
  • 48