I have a peculiar problem. I am developing a Struts 2.2 website. Now in one of the jsps, I use a function which inturn submits to another action.
Now, the problem is if, I call this function when it is present in .js file, it throws me an error "Invalid Argument".
However, if I copy-paste the same method in the jsp, then it works fine.
This is the method. The 0 is also alerted out, when I put the function definitiion in both the js file as well the jsp. However, the page doesn't get submitted from the .js file.
Am I missing something here?
Thanks for your reply. I did have and I changed both the id and the name of the element. I checked the source as well after the page was rendered.Nothing with "submit". but sill the problem persists. This has a very easy workaround, but I hate duplicate code all over the jsps..
Sorry my mistake!! I forgot to mention that it doesn't work if I put the function confirmDeleteEntity() into a js file. In this case, it works as the function is incuded. And no, the form has been completely rendered here. Thanks once again for your review Eric. I so , so want to get to the end of this..