Copy link to clipboard
Copied
Attached is a form I want the deadline to always be the 5th of the upcoming month. e.g., if the current date is 27th of march, the deadline should always be one month ahead. but in this case, the day would always be 5th of the upcoming month. I hope this can be done!
Thanks in anticipation for a quick response.
I see you don't have field for deadline date, so create a field I named it "Deadline_Date" and add new document level script using this:
var month = util.scand("dd-mmm-yyyy", new Date());
month.setMonth(month.getMonth() +1);
var str = util.printd("dd mmmm, yyyy", month);
var newDate = "05"+str.slice(2);
this.getField("Deadline_Date").value = newDate;
Here is your file with everything above added:
https://drive.google.com/uc?export=download&id=1gm7aW8xUlJx4tbyVimvQ6sW1M9Eybyic
Copy link to clipboard
Copied
Hi Nesa,
Probably you have unintentionally skipped my request.
Kindly assist when available.
thanks
Copy link to clipboard
Copied
You didn't answer my question, what should calculation be "Total Amount" - "Advance_Taken" or something else?
Yes, word refund can be added to total.
Copy link to clipboard
Copied
"Total Amount" - "Advance_Taken" = "Grand Total".
if "Advance_Taken" is greater than "Total Amount", "Grand Total" should display in red with a refund word. yes this is what i am hoping for.
Thanks.
Copy link to clipboard
Copied
"Total Amount" - "Advance_Taken" = "Grand Total".
if "Advance_Taken" is greater than "Total Amount", "Grand Total" should display in red with a refund word. yes this is what i am hoping for.
Thanks.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Sorry! My dropdown is not accepting the export value.
I try to copy and paste but it only accepts this (var list = [)
Copy link to clipboard
Copied
Here is file with script included:
https://drive.google.com/uc?export=download&id=1m7_whTSoYdg-9W_KFFqH8_LZrzMSEhkN
Copy link to clipboard
Copied
Copy link to clipboard
Copied
In this line just change 2 to 9:
for(var i=0; i<=2; i++){
Copy link to clipboard
Copied
Dear Nesa,
Hopefully, you're doing great.
I'm having an issue with the attached form. your help would greatly be appreciated.
Kindly help me with this.
Thanks
Copy link to clipboard
Copied
Your fields are named "Products. " not "Product. " also change variable name from 'i' to something else.
var list = ["-Select Nastrade-", "CUBE SUGAR 25*475G", "CUBE SUGAR 50*475G", ];
for(var j=0; j<=2; j++)
this.getField("Products."+j).setItems(list);
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You are missing ]. Can you post full script?
Copy link to clipboard
Copied
here is the script
var list = ["-SELECT HOUSEHOLD-", "ACTION 10*1KG", "ACTION (WHITE) 5KG", "ACTION (WHITE) 12*480G", "ACTION 12*460G", "ACTION (WHITE) 12*500G", "ACTION (WHITE) 1*5KG", "ACTION 10*1KG", "ACTION 40*200G", "ACTION 6*950G", "BEAUTY HAND WASH (9*550ML) - ASSORTED", "BEAUTY LAVENDER HAND WASH - 9*550ML", "BEAUTY HAND WASH (12*550ML) - ASSORTED", "BEAUTY LAVENDER HAND WASH - 9*550ML", "BEAUTY LAVENDER HW 12*550ML", "BEAUTY LEM. GRASS HW 25LTRS-FRASER", "BEAUTY LEMONGRASS HAND WASH 9*550ML", "BEAUTY OCEAN GREEN - HW 25LRS", "BEAUTY OCEAN GREEN HW 9*550ML", "BEAUTY OCEAN HW 12*500ML", "BEAUTY OCEAN HW (GREEN) 12*550ML", "BEAUTY ROSE HAND WASH - 9*550ML", "BEAUTY ROSE HW 12*500ML", "BEAUTY ROSE HW 12*550ML", "BEAUTY SOA\P 60*75G", "BONUS 12*400G", "BONUS 12*400G (HH)", "BONUS 162*18G (B)", "BONUS 162*18G (HH)", "BONUS 162*20G", "BONUS 168*20G(HH)", "BONUS 170*18G", "BONUS 24*180G (HH)", "BONUS 27*200G", "BONUS 27*200G (HH)", "BONUS 40*200G", "BONUS 48*85G", "BONUS 48*85G (HH)", "BONUS 6*900G", "BONUS 6*900G (1 SACHET FREE)", "BONUS 6*900G (HDPE)", "BONUS 7*900G", "BONUS SOA\P 24*250G", "BRYTEX (COLOURS) 12*475G", "BRYTEX (COLOURS) 156*28G", "BRYTEX (COLOURS) 24*180G", "BRYTEX (COLOURS) 6*900G", "BRYTEX (PKT) 40*200G", "BRYTEX 10*1KG" "BRYTEX 12*500G", "BRYTEX 168*25G", "BRYTEX 24*250G", "BRYTEX 40*250G", "BRYTEX 5KG", "BRYTEX 6*1KG", "BRYTEX WHITE 12*475G"BRYTEX WHITE 156*28G", "BRYTEX WHITE 24*180G", "BRYTEX WHITE 6*900G", "GLASS WINDOW CLEANER 25KG - FRASER", "H/WASH-CLEAR - 12*500ML", "HI-POWER 10KG", "INDUSTRIAL BLEACH 25LTRS", "LE CHOICE SOA\P 60*75G", "NOVA SOA\P (PKT) 72*90G", "PLUS CLEAR DW - 25LTRS", "PLUS LEMON DW - FRASER 12*500ML", "PLUS LEMON DW 12*1050ML", "PLUS LEMON DW 12*520ML", "PLUS LILLY DW - FRASER 12*500ML", "PLUS LILLY DW 12*1050ML", "PLUS LILLY DW 12*520ML", "PLUS SOA\P WHITE 48*150G", "PLUS SOA\P YELLOW 48*150G", "PLUS WHITE DET. 156*30G", "SHEA BUTTER CREAM 24*200ML", "SHORT BAR SOA\P (CREAM) 60*170G", "SHORT BAR SOA\P 100*100G", "SHORT BAR SOA\P 48*150G", "SLASH 10KG", "SLASH 5KG", "SLASH 6*2KG", "SOFN FREE - 32 (8x4)*140G", "SOLAR 27*190G", "SOLAR 5KG", "SOLAR 26*150G (HDPE)", "SOLAR 50*60G (HDPE)", "TOILET CLEANER - FRASER 25LTRS 12*500ML"];
for(var n=0; n<=5; n++)
this.getField("Products."+n).setItems(list);
Copy link to clipboard
Copied
You are missing comma here:
"BRYTEX 10*1KG", "BRYTEX 12*500G"
and comma and quotation here:
"BRYTEX WHITE 12*475G","BRYTEX WHITE 156*28G",
Copy link to clipboard
Copied
it's working now. thanks for your help.
Copy link to clipboard
Copied
Dear Nesa,
Thanks for everything thus far.
My problem today is,
The dependant dropdown was switching properly yesterday via the radio buttons until this morning. I can't figure out the problem. it switches only the first dropdown correctly for all three radio button choices but the rest don't change as expected despite changing the variables.
Pls, help look at it again for corrections.
Thanking you a million times.
Copy link to clipboard
Copied
Making variable name to be unique in all 3 buttons fixed it, but not sure if that is issue, try testing file and see how it behave:
https://drive.google.com/uc?export=download&id=1LE-QNB6EshRd55ROOIvePe2Xsa10-wa3
Also from what I saw 'clear form' button didn't clear all dropdown field, you should look at that.
Copy link to clipboard
Copied
it's working great now. I have also fixed the reset button.
Thanks a lot for everything.
Copy link to clipboard
Copied
Hello nesa,
I have come seeking your help again.
I am hoping that if one clicks on the radio button "Choice1", you should get a 2% cash discount with an app alert congratulating you. and when you click on the radio button "Choice2" you are to get a no discount with an app alert notifying "sorry no discount on credit"
I have attached the form
Thanks