confirmation box after mysql eval in php list plugin

wassy83

New Member
Hi to all,
when I press php plugin list button I just want a confirmation box that will be showed only if a field in my database is different from NULL. I just added in javascript box this code


confirm("ticket already exist, do you wish to continue?");

and this work, if result is true will execute my php code and if is false nothing happens. problem is that I want box will showed only if tickets field is different form NULL.. but I think that is impossible to insert in javascript box a mysql query.. please I need some tips..:(
 
ok thank you for your reply but I'm not so good with javascript but I tried this, 2 questions:
1 - the code will be past in javascript box under php list plugin?
2 - I wrote this code following examples but obviously won't work:

in mysql:
table is attribuzione_biglietti
field is tickets
form id is 2

var formRef = 'form_2';
var elementName = 'attribuzione_cabine___tickets';
var tickets = elementName.get('value');
if (tickets === 1759867) {
confirm("ticket already exist, do you wish to continue?");
}
else {
return false;
}


give me some tips please, I think that is not so diffucult
 
searching in the forum I found that the best way in fabrik to retrieve data through javascript is


var element = form_2.formElements.get('attribuzione_biglietti___tickets').getValue();
window.alert(element);


but this simple code don't show any box :(
 
Back
Top