Hi,
I'm looking for a sollution to check the things filled in on my subform.
When the user select p.ex. item with code '100' (whith the lookup) he also need to select item '110'
I want to get an alert before safe when item 100 is selected but item 110 is missing.
How to get it work?
Thanks
Johan
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
nubeforeSave or other function?
nubeforeSave or other function?
You do not have the required permissions to view the files attached to this post.
Re: nubeforeSave or other function?
johan,
I haven't tested it but this should work for you..
Steven
I haven't tested it but this should work for you..
Code: Select all
function nuBeforeSave(){
if(hasValue('100') && !hasValue('110')){
alert('110 needs to be added');
return false;
}else{
return true;
}
}
function hasValue(pCode){
var sfName = 'thesubform'; //-- the subform name to look in
var fdName = 'thefield'; //-- the field name to look in
var ar = Array();
ar = nuSubformRowArray('FMinvoice_item');
for(var i = 0 ; i < ar.length ; i++){
if(document.getElementById(ar[i] + fdname).value == pCode){
return true;
}
}
return false;
}
Steven