We help IT Professionals succeed at work.

html form within the form

Webboy2008
Webboy2008 asked
on
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">
            <tbody>
            <tr>
                <td><center>Class ID</center></td>
                <td><center>Life Cycle State</center></td>
                <td><center>VSSite</center></td>
                <td><center>Condition</center></td>
            </tr>
            <tr>
                <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>
            </tr>
            </tbody>
        </table>
<form name="ieBad">
<table border="0" id="tblRevision1">
            <tbody>
            <tr>
                <td><center>Event ID</center></td>
                <td><center>Event Format</center></td>
                <td><center>Event Data</center></td>
            </tr>
            <tr>
                <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>
	    <tr><td colspan=3>
			<button name="Add2" value="submit" type="submit" >Add</button>

		</td>
            </tr>
            </tbody>
</table>
</form> 
<button name="Add" value="submit" type="submit" >Add</button>
</form>

Open in new window

Comment
Watch Question

RobOwner (Aidellio)
Most Valuable Expert 2015

Commented:
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>