Forum Moderators: open

Message Too Old, No Replies

Problem with form submit

cant figure out why these 2 forms dont submit

         

sneaks

2:49 am on Nov 4, 2007 (gmt 0)

10+ Year Member



i am only getting the submit=>submit in the POST array on a page that has multiple forms on a web app i am trying to develop... any ideas?


<form id="frm_add_category" action="index.php?section=admin&amp;item=categories" method="post">
<table cellpadding="4" cellspacing="0" border="0">
<tr>
<td style="width:60px;"><input id="submit_add" name="submit_add" type="submit" value="add article" class="sub_add" onmouseover="javascript:$(this).toggleClass('icon_hover');" onmouseout="javascript:$(this).toggleClass('icon_hover');" /></td>
<td colspan="2"><input type="text" value="add a category" class="inp_add" /></td>
</tr>
</table>
</form>
<strong>Current categories:</strong>
<form id="frm_edit_category" action="index.php?section=admin&amp;item=categories" method="post">
<table cellpadding="4" cellspacing="0" border="0">
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">1</td>
<td style="width:740px;"><input type="text" value="Music" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">2</td>
<td style="width:740px;"><input type="text" value="Art" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">3</td>
<td style="width:740px;"><input type="text" value="Tribute" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">4</td>
<td style="width:740px;"><input type="text" value="Editorial" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">5</td>
<td style="width:740px;"><input type="text" value="Commentary" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">6</td>
<td style="width:740px;"><input type="text" value="Interview" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">7</td>
<td style="width:740px;"><input type="text" value="Essay" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">8</td>
<td style="width:740px;"><input type="text" value="Prose" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">9</td>
<td style="width:740px;"><input type="text" value="Book Review" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td style="width:60px;"><a href="#" title="delete" class="icon b_delete">remove</a></td>
<td style="width:30px;">10</td>
<td style="width:740px;"><input type="text" value="Film Review" onfocus="javascript:$(this).toggleClass('highlight');" onblur="javascript:$(this).toggleClass('highlight');" /></td>
</tr>
<tr>
<td colspan="4">
<input name="submit_edit" type="submit" value="Publish Changes" class="sub_publish" onmouseover="javascript:$(this).toggleClass('icon_hover');" onmouseout="javascript:$(this).toggleClass('icon_hover');" />
</td>
</tr>
</table>

thanks

Fotiman

4:55 pm on Nov 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ugh...
1. You're WAY overusing tables for your layout (that's what CSS is for).
2. You're also mixing behavior with presentation by using inline event handlers (better to put those event handlers in a separate script).
3. Your second form is missing a closing </form> tag.

sneaks

9:44 pm on Nov 4, 2007 (gmt 0)

10+ Year Member



haha thanks but i decided to go with ajax instead since i already loaded jquery and it was more appropriate. as far as tables go, its all just preemptive layout so dont worry no need to even use divs, i styled the actual elements...

take care,

jd