Copy link to clipboard
Copied
hi, i'm using bellow script with drop down field. what i want to do is, if select "SGD" in drop down, fields "EX" value should be empty. if select any other value in drop down, need to popup message "Please fill exchange rate". ps help me to edit bellow script. thanks in advance. thanks..
var sNewSel = event.value;
switch (sNewSel) {
case "SGD":
this.getField("EX").value = "";
}
Add this if-condition before the alert:
if (this.getField("EX").valueAsString=="")
app.alert("Please fill exchange rate");
Copy link to clipboard
Copied
Add this to the switch statement:
default: app.alert("Please fill exchange rate");
Copy link to clipboard
Copied
hi, thanks a lot. can u pls give me the compete code inserting your code. thanks in advance.
Copy link to clipboard
Copied
I forgot to mention that you also need to add a "break" command... Here's the full code:
var sNewSel = event.value;
switch (sNewSel) {
case "SGD":
this.getField("EX").value = "";
break;
default:
app.alert("Please fill exchange rate");
}
Copy link to clipboard
Copied
thanks a lot & it's working perfectly.. i just want add another condition into it so pls help me.
if select anything other than "SGD" & field "EX" is empty then only need to popup that message.
if fields "EX" already available values then no need that popup massage. thanks..
Copy link to clipboard
Copied
Add this if-condition before the alert:
if (this.getField("EX").valueAsString=="")
app.alert("Please fill exchange rate");
Copy link to clipboard
Copied
thanks a lot & it's work perfectly..