Getting the field value from one tab in another tab

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
riyaz.kalva
Posts: 2
Joined: Sun Dec 27, 2015

06 Jan 2016

Hello sir,

I am customizing the New/Edit forms of a list. I have used tab control under which I have added 4 tabs among them 3 are to get the user input and the last tab i.e. 4th tab is to show the preview. I want to show the preview to user for input that user has made.



In fourth tab I have added HTML control and added HTML like below:

<Table>

<Tr>

<Td>Title</Td>

<Td id='TitleText'></Td>

</Tr>

</Table>



In JavaScript editor, (by selecting the JS menu from ribbon) I have added follwing code:

var title=fd.field('Title').value(); // the title control is placed in first tab among four tabs

$("#TitleText).html(title);



I am not getting the control value in the "TD". But if I place one button on first tab (Where the title control reside) and on click event if I access the value of Title control (by adding alert box in JavaScript). I am getting it. What should I do to display the field value in another tab?

Thanks.

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

07 Jan 2016

Hi,

As I can see you've missed a double quote after #TitleText in your code. Try to use the following snippet:

Code: Select all

function setTitleText() {
	var title = fd.field('Title').value();
	$('#TitleText').html(title);
}

fd.field('Title').change(setTitleText);
setTitleText();

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests