Setting a Field Value
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
-
Dmitry KozlovAdminMember for: 7 years 5 months 10 days
Hi Matt,
Could you send HTML-source of your form page to [email protected]?