Monday, May 25, 2009

Multiple form submission due to background attribute in "td" tag

Our team faced an issue with a particular module. The form was getting submitted more than once. We tried hard to figure out a solution for the problem. Finally we found that the problem was due to a normal "td" tag in the .jsp file. We had by mistake given an attribute “background” to that "td". The attribute “background” works absolutely fine within a td as long as the value to the attribute is a path to an image file. But incase you give a color code (say #FFFFFF) it begins to behave abnormally. Example: background="c:/example.gif” td tag This works fine Whereas background="#FFFFFF" in td tag doesn’t work If you want to change the background color of your "td" use “bgcolor” attribute. The attribute can take color codes as value. Note: background="red" also works fine in IE. This could be because the browser corrects the programmer’s mistake and converts it into bgcolor=”red” internally.

No comments:

Post a Comment