Can you use a "click" or "onclick" handler on SharePoint fields?
When I add some code to perform an action for "onclick," nothing happens.
In my browser debugger, it says "Object doesn't support property or method 'click'
Is there a way to make this work?
I'm using --> fd.field('fieldname').click(function() {
//insert code here;
});
In my browser debugger, it says "Object doesn't support property or method 'click'
Is there a way to make this work?
I'm using --> fd.field('fieldname').click(function() {
//insert code here;
});
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Sure, please, try the code below:
Code: Select all
fd.field('fieldname').control()._el().find('input').click(function(){
// your code here
});
Thanks Dmitry! That works perfectly
Any idea why that works and fd.field('fieldname').click(function() doesn't work?
Only reason I ask is so that I can understand the Forms Designer framework a little better so that I don't have to bug you on questions like these in the future.
Thanks again!
Any idea why that works and fd.field('fieldname').click(function() doesn't work?
Only reason I ask is so that I can understand the Forms Designer framework a little better so that I don't have to bug you on questions like these in the future.
Thanks again!
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
fd.field('fieldname') returns Field object that doesn't contain click method. But you can retrieve jquery-object with the help of control()._el() method and find a particular html-element.
fd.field('fieldname') returns Field object that doesn't contain click method. But you can retrieve jquery-object with the help of control()._el() method and find a particular html-element.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
'fieldname' is an internal name of a SharePoint column.
'input' is an html-element that is rendered by the field.
Please, find more info in our documentation:
http://spform.com/documentation/js/field
And the blog:
http://spform.com/office-365/cond ... ynamically
'input' is an html-element that is rendered by the field.
Please, find more info in our documentation:
http://spform.com/documentation/js/field
And the blog:
http://spform.com/office-365/cond ... ynamically
-
- Information
-
Who is online
Users browsing this forum: No registered users and 28 guests