Okay i am going nuts here i have a jsp page with multiple task to complete add,delete update . in order to do so i knopw i must set vlaues of a hidden input to say add,delete or update based upon what buttom was pressed so i have made the following code.
the forms name is test
the hidden inputs:
<input type="hidden" name="m1" value="" />
//set to blank
the button:
<input name="Add" type="submit" value="Add" alt="Add" onclick='javascript:return add();'
<input name="Update" type="submit" value="Update" alt="Update" onclick='javascript:return Update();'
<input name="Dekete" type="submit" value="Delete" alt="Delete" onclick='javascript:return Delete();'
The javascript:
function add(){
alert("this shit worked")
document.test.getElementById("m1").value = "Add"
alert(document.test.getElementById("m1").value);
}
I am using the same code as above for the update and delte just changing the function name and the values entered
I am then validating the Jsp code to only work if the value is for example add - does the add code i know the validation works as i have manually entered the values and it worked a treat.
I am very new to JS so any help would be appreciated
I have the JS code in the <script> </script> because i have other validation elements working so this is not the issue.
The problem: The above code does not seem to change the hidden inputs value
Thanks in advance