Hi
I want to give dropdown parameter
Original
Duplicate
Triplicate
I want if user selects Original,Triplicate then 2 invoices will Original & Duplicate should get printed
Thanks
Hi
I want to give dropdown parameter
Original
Duplicate
Triplicate
I want if user selects Original,Triplicate then 2 invoices will Original & Duplicate should get printed
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tasadduq BurneyRank #1,427 · 1.1K reputationPosted Aug 17, 2023, 4:02 AM EDT
To achieve this, you would typically need to use some programming or scripting language to handle the logic. Here's a basic example using JavaScript for a web-based interface:
Invoice Printing Select invoice options: Original Duplicate Triplicate Print Invoices function printInvoices() { const selectedOptions = document.getElementById("invoiceOptions").selectedOptions; const selectedValues = Array.from(selectedOptions).map(option => option.value); if (selectedValues.includes("Original") && selectedValues.includes("Triplicate")) { // Print both Original and Duplicate invoices console.log("Printing Original and Duplicate invoices"); } else { console.log("Printing selected invoices:", selectedValues); } }Ramco RamcoRank #462 · 5.4K reputationPosted Aug 17, 2023, 2:32 AM EDT
Hi
How it will generate 2 copies. Original & Duplicate
Thanks
Amit MohantyRank #112 · 20K reputationPosted Aug 17, 2023, 2:51 AM EDT
Hey Ramco, you have to call your PrintInvoice function (If you don't have then create a PrintInvoice function which will print your invoice.) two times when the user select "Original" and "Triplicate" with labeled as "Original" and "Duplicate".
Tasadduq BurneyRank #1,427 · 1.1K reputationPosted Aug 19, 2023, 2:23 PM EDT
Here's an example of how you might implement the dropdown parameter and logic using HTML and C
#include #include #include int main(void) { // Read the selected option from the form data char *data = getenv("QUERY_STRING"); char *selected_option = strtok(data, "="); selected_option = strtok(NULL, "="); // Check the selected option and print invoices accordingly printf("Content-Type: text/html\n\n"); printf("Invoice Printing Result"); if (selected_option != NULL) { if (strcmp(selected_option, "Original") == 0 || strcmp(selected_option, "Triplicate") == 0) { printf("Printing Original invoice... "); printf("Printing Duplicate invoice... "); } else if (strcmp(selected_option, "Duplicate") == 0) { printf("Printing Duplicate invoice... "); } else { printf("Invalid selection "); } } else { printf("No option selected "); } printf(""); return 0; }Saravanan GanesanRank #153 · 15.1K reputationPosted Aug 16, 2023, 1:27 PM EDT
You can create a dropdown parameter with options: "Original," "Duplicate," and "Triplicate." If a user selects "Original" and "Triplicate," you can programmatically generate and print two invoices, one labeled as "Original" and the other as "Duplicate." This selection will generate the desired outcome of having both an "Original" and a "Duplicate" invoice printed. This approach ensures that the user's selections are used to trigger the appropriate invoice generation and printing, streamlining the process and ensuring accurate documentation.
Ramco RamcoRank #462 · 5.4K reputationPosted Aug 20, 2023, 1:26 AM EDT
Hi Mohanty
Can u pls provide some sample code
Thanks