Setting a Field Value
Posted: 19 Feb 2014
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/ ... -form.html
http://spform.com/documentation/js/field
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/ ... -form.html
http://spform.com/documentation/js/field