Button Text with JavaScript?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
slashmaster
Posts: 29
Joined: Fri May 25, 2018

20 Aug 2018

Hi,

i am using some "Button" from Control-List. There is a Property called "Text" to set the displayed Button-Text.
How can i modify this in a Displayform with Javascript?

The button gots a css-class called "btn_one"
this is what i tried already:

Code: Select all

$(".btn_one").text("hello world"); //nothing happened
$(".btn_one").control()._el().text("hello world"); //error
$(".btn_one").value("hello world"); //error
$(".btn_one").html("hello world"); //nothing happened
$(".btn_one").hide(); //works for example, to hide the button
Some ideas? :) thanks in advanced

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

20 Aug 2018

Please, use the code below:
$('.btn_one').val('hello world')

slashmaster
Posts: 29
Joined: Fri May 25, 2018

21 Aug 2018

Hello Dmitry,

works well, ty :-)

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests