0

Hi

I have a form that amends current values in a MySQL database.

This works fine in FireFox, but does nothing in IE when you click on the Save button.

<input type="button" value="SAVE" onclick="submit();" />

Is what I am using

What am I doing wrong?

Thanks

Edited by manc1976: n/a

3
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by Troy III
0

try changing:

<input type="button" value="SAVE" onclick="submit();" />

to:

<input type="submit" value="SAVE"  />
0

Hi

That gave the same result. It might be easier if I post the start of the form code for you to see:

<form name="EditHome" method="post" enctype="multipart/form-data" action="SaveHome.php">
<input type="hidden" name="id" value="<?= $id ?>">

<table align="center" width="100%" border="0" bgcolor="f59422" cellspacing="0" cellpadding="0">


<tr>
<td valign="top" height="50">
    <table width="100%">
    <tr>
<td valign="top" height="50">
    <table width="100%" bgcolor="f8ab60">
    <tr>
    <td valign="top">
	    <table width="100%">
	    <tr>
		<td valign="top">
		<FORM>
<INPUT TYPE="button" VALUE="Return to Property Admin" onClick="parent.location='property_admin.php'">
</FORM>
</td>
<td valign="top">
		<FORM>
<INPUT TYPE="button" VALUE="Add a Picture" onClick="parent.location='AddPicture.php?home_id=<?= $id ?>'">
</FORM> 
</td>
<td valign="top">		
		<input type="button" value="SAVE" onclick="submit();" />
		
		</td>
		</tr>
		</table>
    </td>
    </tr>
    </table>
</td>
</tr>
</tr>

    </table>
</td>
1

You are not allowed to nest HTML forms. To clarify, this is NOT allowed:

<form action="test1.php">
  ...
  <form action="test2.php">
    ...<input type="submit" value="Inner Submit" />
  </form>
  ...<input type="submit" value="Outer Submit" />
</form>

You have to get rid of the inner form(s). You can nest the entire table within a "master" form:

<form name="EditHome" method="post" enctype="multipart/form-data" action="SaveHome.php">
<input type="hidden" name="id" value="<?= $id ?>">

<table align="center" width="100%" border="0" bgcolor="f59422" cellspacing="0" cellpadding="0">


<tr>
<td valign="top" height="50">
    <table width="100%">
    <tr>
<td valign="top" height="50">
    <table width="100%" bgcolor="f8ab60">
    <tr>
    <td valign="top">
	    <table width="100%">
	    <tr>
		<td valign="top">
		<!-- <FORM> -->
<INPUT TYPE="button" VALUE="Return to Property Admin" onClick="parent.location='property_admin.php'">
<!-- </FORM> -->
</td>
<td valign="top">
		<!-- <FORM> -->
<INPUT TYPE="button" VALUE="Add a Picture" onClick="parent.location='AddPicture.php?home_id=<?= $id ?>'">
<!-- </FORM>  -->
</td>
<td valign="top">		
		<input type="submit" value="SAVE"  />
		
		</td>
		</tr>
		</table>
    </td>
    </tr>
    </table>
</td>
</tr>
</tr>

    </table>
</form>

Edited by hielo: n/a

Votes + Comments
Well Explained, Thanks
0

That is perfect, Thanks

Why does it work on FireFox the original way I had it?

0

There is no specification that formally states how to behave when forms are nested. Thus, different browser developers handle it differently. Some of them ignore the nested elements. Others use the inner-most form. The only way to achieve consistency is to get rid of the nested forms.

0

Thank you for the clear explanation and for sorting my code out. :D

0

That is perfect, Thanks

Why does it work on FireFox the original way I had it?

have you tried validating your previous html?
do it -and you may find your answer there.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.