How to set value to asp:textbox, added to the form as HTML?


Posted by Дмитрий Фоломеев - Nov 26 ’14 at 11:16

How to set value to asp:textbox (not sharepoint field), added to the form as HTML?


For example, I added asp:TextBox (as HTML) to form:

<asp:TextBox runat="server" id="TextBox100" ></asp:TextBox>


I want to set the field value, and do other changes using javascript:

fd.field('TextBox100').value('100');- not work

document.getElementById('TextBox100').value= "100"; - not work

please help.

  • Dmitry Kozlov
    Dmitry Kozlov
    Member for: 9 years 10 days
    #1 by Dmitry Kozlov Nov 27 ’14 at 09:52

    Hi Dmitry,

    You can assign a CSS class to the textbox:

    <asp:TextBox runat="server" id="TextBox100" CssClass="my-textbox" ></asp:TextBox>

    And use it in your JS-code following way:

  • Дмитрий Фоломеев
    Дмитрий Фоломеев
    Member for: 7 years 10 months 5 days
    #2 by Дмитрий Фоломеев Nov 27 ’14 at 10:31

    Thank you, it works!

Displaying 1 to 2 of 2 messages