I have a javascript that automatically creates form elements on the fly using createElement. One of the elements is a simple input form box that is disabled by default. Below I have code that will run through items (which is a counter that counts the number of rows of form elements I have created (I create 4 form elements, QTY, DESCRIPTION, PRICE, DISCOUNT) per row).
function enablediscount(){
for (x = 1 ; x <= items; x++){
var discount = document.getElementById("discount"+x)
discount.disabled=false;
}
}
Now, I want to run the above code upon a check against users and passwords in a mysql table. (Basically a manager)
Basically, I want maybe a small popup window that will ask for a username and password of a manager to enable the discount field so the user (in this case, a cashier) can input the discount
Any ideas?