Dear All,
Why I can not get value from Field or Text if I set properties as Display Only or Hidden.
Sample:
I have treeview, Field_B value is from treeview Node:
function setNode(parentId,childId,parentName,childName,menuMap){
$('.Field_B_class').map(menuMap);
}
field_B set as Display Only or Hidden, then I want to check Field_B value by display it on Field_A
document.getElementById('field_A').value = document.getElementById('Field_B').value;
result is Field_A will Blank (no value) , but if field_B not hidden/not display only, field_A will get field_B value
Regards
Juned
Cannot get value with propertis hidden or display only
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 35
- Joined: Mon Jul 14, 2014 11:55 pm
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Juned,
If it's hidden, then Ebase will not include it on the page so you can't check it. If you want it to be both hidden AND included on the page you should use css "display:none;" instead of the control hidden attribute. You can set this in the designer by clicking the Advanced Properties button within each control's styling assistant.
If it's display only, then your document.getElementById() method is going to return the HTML element containing the field value - in this case it will be a <span> tag (I think) whereas if the field is editable it will be an <input> tag. My point is that the Javascript object returned for the span tag probably doesn't have a value property which is why it doesn't work. You might need to use the textContent property instead. Alternatively, use jQuery instead of native Javascript - jQuery has val() and text() methods.
Hope this makes sense.
Jon
If it's hidden, then Ebase will not include it on the page so you can't check it. If you want it to be both hidden AND included on the page you should use css "display:none;" instead of the control hidden attribute. You can set this in the designer by clicking the Advanced Properties button within each control's styling assistant.
If it's display only, then your document.getElementById() method is going to return the HTML element containing the field value - in this case it will be a <span> tag (I think) whereas if the field is editable it will be an <input> tag. My point is that the Javascript object returned for the span tag probably doesn't have a value property which is why it doesn't work. You might need to use the textContent property instead. Alternatively, use jQuery instead of native Javascript - jQuery has val() and text() methods.
Hope this makes sense.
Jon
0 x
-
- Ebase User
- Posts: 35
- Joined: Mon Jul 14, 2014 11:55 pm
Who is online
Users browsing this forum: No registered users and 23 guests