We help IT Professionals succeed at work.

html form within the form

Webboy2008 asked
Is that possible to nest the html form? For some reasons, I have to do this way.
It is customized in classic asp, and it is hard to explain why.

If yes, how can I get the value from nested forms in javascript...or classic asp
<form name="submitPage" action="package.servletName">
<table border="0" id="tblClass">
                <td><center>Class ID</center></td>
                <td><center>Life Cycle State</center></td>
                <td><input type="text" name="reqClassId" value="-" /></td>
                <td><input type="text" name="reqLifeCycleState" value="-" /></td>
                <td><input type="text" name="reqVSSite" value="-" /></td>
                <td><input type="text" name="reqCondition" value="-" /></td>
<form name="ieBad">
<table border="0" id="tblRevision1">
                <td><center>Event ID</center></td>
                <td><center>Event Format</center></td>
                <td><center>Event Data</center></td>
                <td><input type="text" name="reqEventID1" value="-" /></td>
                <td><input type="text" name="EventFormat1" value="-" /></td>
                <td><input type="text" name="reqEventData1" value="-" /></td>
	    <tr><td colspan=3>
			<button name="Add2" value="submit" type="submit" >Add</button>

<button name="Add" value="submit" type="submit" >Add</button>

Open in new window

Watch Question

RobOwner (Aidellio)
Most Valuable Expert 2015

No it's not possible to nest the form and it doesn't make sense.  If it is a layout issue then that's a different story but a form is a logical container for controls not other forms.
unless you can provide more information then you can't do it reliably
It is not possible to have more than one form tag. Following options are there:

<div id="form2"> can be used
<table id="form2"> can be used
The form content can be keep in another html file and the file can be loaded in Main HTML file using <iframe>