Field returns undefined
Hi there
I have a 'YesNo' Field and I would like to check if it is selected. I have following code:
fd.field('Other_x0020_baseware_x002d_users').readonly(false);
alert(fd.field('Other_x0020_baseware_x002d_users').value());
I do get undefined as alert...what did I do wrong?
I have a 'YesNo' Field and I would like to check if it is selected. I have following code:
fd.field('Other_x0020_baseware_x002d_users').readonly(false);
alert(fd.field('Other_x0020_baseware_x002d_users').value());
I do get undefined as alert...what did I do wrong?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Is it a new, edit, or display form? If the field is rendered in the read only mode, you should use the following code to get its value:
Is it a new, edit, or display form? If the field is rendered in the read only mode, you should use the following code to get its value:
Code: Select all
fd.field('Other_x0020_baseware_x002d_users').control()._el().text()
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Could you send HTML-source of your form page to support@spform.com? Thanks!
hi there..... I have a another problem with multiline rich textfield
although I found this post in the forum it is not working for me.
when i do the following:
fd.field('Justification').control()._el().find('div.ms-rtestate-write').text().replace(/\W/g, '');
if (!fd.field('Justification').control()._el().find('div.ms-rtestate-write').text()) {
....
It will not enter the if statement when Justification is empty. When I add Trim.....it deletes all the text in Justification.... What did I do wrong?
although I found this post in the forum it is not working for me.
when i do the following:
fd.field('Justification').control()._el().find('div.ms-rtestate-write').text().replace(/\W/g, '');
if (!fd.field('Justification').control()._el().find('div.ms-rtestate-write').text()) {
....
It will not enter the if statement when Justification is empty. When I add Trim.....it deletes all the text in Justification.... What did I do wrong?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, make sure that you pass the correct internal name of the field into fd.field() method. Also ensure that the type of field is Rich Text, not Enhanced Rich Text or Plain Text.
Hello Dimitry
Thanks. I actually do use an enhance richt text field. It works now, when I use this code:
var text = fd.field('Justification').control()._el().find('div.ms-rtestate-write').text().replace(/\W/g, '');
if (text == '') {
...
}
Apparenty, I have to save the result of the method replace in a variable, otherwise it is not working...
Thanks. I actually do use an enhance richt text field. It works now, when I use this code:
var text = fd.field('Justification').control()._el().find('div.ms-rtestate-write').text().replace(/\W/g, '');
if (text == '') {
...
}
Apparenty, I have to save the result of the method replace in a variable, otherwise it is not working...
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests