I have a page that displays employee information for a company. The list is split into 3 groups. Each group has an add button and an edit button. The buttons call the respective subform in a modal window.
Since the forms are built in vb.net and use ASP objects, they need the form to be wrapped in a form that has runat="server". I am unable to add the run at server directive to each of the 6 sub forms's form tags as I can only have one runat="server" per page.
To get around that, I added the directive to a form element that wraps the body of the page. Now I'm getting an error because of nested form elements. How do I get around this?
<body>
<form runat="server">
<form id="popup1">
</form>
<form id="popup2">
</form>
<form id="popup3">
</form>
<form id="popup4">
</form>
<form id="popup5">
</form>
<form id="popup6">
</form>
</form>
</body>
I read about the form elements getting a form attribute that ties the elements to a particular form as in form="form1" and so on. But I'm not sure if that will work in my case since some folks may try to use Internet Explorer which does not support the form attribute.
I'm thinking that I need to create only one modal form for my page, add all the elements for all six forms and then use logic to show/hide elements based upon which button is pressed. The problem is that the forms are rendered on the server side using asp elements and the button press is client side. I could use some javascript to handle this, but things could get messy. Additionally, the forms may get loaded with data or not depending on whether the button presses is add employee or edit employee.
Maybe I should create the 6 modal forms without using asp objects and stick to HTML objects. This negates the use of ASP's regular expression validators but I'm ok with that.