Setting a Field Value

rss

Posted by schuess - Feb 19 ’14 at 12:23

I am attempting to set a fields value and am having issues. My test alert is returning undefined.

 

fd.field('reqFormSub').change(function() {

if (fd.field('reqFormSub').control().value() == 'No'){

$('.mycontractLang').css("Display","inline"); //this is a seperate text line and this is working

//below are all my attempts to set the value of a simple text input!

//fd.field('contractLang').control()._el().find('input').val("If NO, Please review contract language with RM.");

//fd.field('contractLang').control().value() = "If NO, Please review contract language with RM.";

//fd.field('contractLang').attr('value', "If NO, Please review contract language with RM.");

//fd.field('contractLang').control().value('If NO, Please review contract language with RM.');

//fd.field('contractLang').control().val('If NO, Please review contract language with RM.');

alert(fd.field('contractLang').control()._el().find('input').val());

alert(fd.field('contractLang').control().value());

} else{

$('.mycontractLang').css("Display","none");

//fd.field('contractLang').control()._el().find('input').val("");

};

});

 

I have reviewed the following posts:

http://formsdesigner.blogspot.com/2013/04/getting-and-setting-sharepoint-form.html

http://spform.com/documentation/js/field

Displaying 1 to 1 of 1 messages