How to set value to asp:textbox, added to the form as HTML?
- Дмитрий Фоломеев
- Posts: 13
- Joined: Tue Nov 25, 2014
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.
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
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
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:
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:
Code: Select all
$('.my-textbox').val()
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests