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

Discussions about Forms Designer for SharePoint 2010.
Locked
User avatar
Дмитрий Фоломеев
Posts: 13
Joined: Tue Nov 25, 2014

26 Nov 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.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

27 Nov 2014

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:

Code: Select all

$('.my-textbox').val()

User avatar
Дмитрий Фоломеев
Posts: 13
Joined: Tue Nov 25, 2014

27 Nov 2014

Thank you, it works!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests