Function is not defined
I have the following function in my javascript
function myFunc(){
var myURL = fd.field('urlOfMeetMin').value();
//alert(myURL)
window.location.href= myURL;
}
I added a button to the form, and in the Onclick config box i put
myFunc();
Error: myFunc is not defined
function myFunc(){
var myURL = fd.field('urlOfMeetMin').value();
//alert(myURL)
window.location.href= myURL;
}
I added a button to the form, and in the Onclick config box i put
myFunc();
Error: myFunc is not defined
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
Please, define your function globally:
Now, you can use it in OnClick handler.
Please, define your function globally:
Code: Select all
window.myFunc = function(){
var myURL = fd.field('urlOfMeetMin').value();
//alert(myURL)
window.location.href= myURL;
}
Thank you, that worked.
I just can not seem to grab the value of the field: fd.field('urlOfMeetMin').value(); Keeps returning undefined.
//window.myFunc = function(){
//var myURL = fd.field('urlOfMeetMin').value();
//alert(myURL)
//window.location.href= myURL;
//}
//window.myFunc = function(){
//window.location.href =fd.field('urlOfMeetMin').value();
//}
I just can not seem to grab the value of the field: fd.field('urlOfMeetMin').value(); Keeps returning undefined.
//window.myFunc = function(){
//var myURL = fd.field('urlOfMeetMin').value();
//alert(myURL)
//window.location.href= myURL;
//}
//window.myFunc = function(){
//window.location.href =fd.field('urlOfMeetMin').value();
//}
UPDATE
i got it to work, but it was the documentation that was throwing me off
On site: http://spform.com/forms-designer- ... eld-values
It says use this to get a fields value: fd.field('Title').value();
But really this is what works. fd.field('Title').control()._el().text();
i got it to work, but it was the documentation that was throwing me off
On site: http://spform.com/forms-designer- ... eld-values
It says use this to get a fields value: fd.field('Title').value();
But really this is what works. fd.field('Title').control()._el().text();
if that's a textbox control, you're missing .control(), before .value(). Take a look at the following link
http://spform.com/forms-designer- ... eld-values
http://spform.com/forms-designer- ... eld-values
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests