Jump to content

Uncaught Typeerror: Object #<Htmlcollection> Has No Method 'submit'


Recommended Posts

Something has gone very wrong with Google Chrome as of late or I'm missing something. Something that I know worked not too long ago now doesn't work at all and produced an error message that makes no sense to me.

 

 

   <form style="margin: 0px; margin-bottom:0px; margin-top:-1px;" name="menuitem_home" id="menuitem_home" method="POST" action="index.php" />
  <input type="hidden" name="menuitemid" value="index.php" />
   <table  class="Navigationv5table" border="0" cellpadding="1" cellspacing="1" width="<?php echo $icons_width;?>" height="<?php echo $icons_height;?>" onclick="javascript:document.menuitem_home.submit();toggle('navigationdisplaypanel');" />
 <tr>
  <td width="100%" height="100%" align="center" valign="middle">
   <img src="images/_interface/menu_icon_home.png">
   </td>
  </tr>
 <tr>
  <td align="center" valign="middle">
   <font size="3" color="#FFFFFF">
    Home
    </font>
   </td>
  </tr>
 </table>
 </form>

 

 

When you click on the table the form should submit, but i get the error. The only way around the error is to create a submit button and click on it. That wont work for what I want to do here and this used to work. What is going on to cause it to generate the error: Uncaught TypeError: Object #<HTMLCollection> has no method 'submit'

 

 

Thanks.

Yes there is only one menuitem_home. Did something recently change where you MUST call submit by the form ID?

 

this works:

 

document.getElementById('redirect_form_3').submit();

 

but this wont

 

document.redirect_form_3.submit();

 

also, this has a really odd consequence in that form targets to new windows wont work. it will ALWAYS go to a new tab regardless s of what I tell it to do. BUT if I click an actual form submit button i will get the window in the right location and proper window size

 

 

Here is the window problem that will produce two windows

 

function openmapchild(file,window) {
   childWindow=open(file,window,'status=1,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1,height=700,width=800');
   if (childwindow.opener == null) childwindow.opener = self;
   }

 

<form style="margin-bottom:0;" action="<?php echo $functionworkorderpage;?>" method="POST" name="Workorderreportform" id="Workorderreportform" target="ViewWorkOrder" onsubmit="openmapchild('<?php echo $functionworkorderpage;?>','ViewWorkOrder');" >
<input type="hidden" NAME="recordid" ID="recordid"  value="<?php echo $disid;?>">
<table border="0" cellpadding="0" cellspacing="0" class="table_bottom_right_container_button"  />
<tr>
<td class="table_button_bullet_right_dark1_normal" onclick="javascript:document.getElementById('Workorderreportform').submit();" />
 
</td>
<td class="table_button_bullet_lead_dark1_normal" />
<input type="submit" value="Work Order" width="10" class="table_button_bullet_lead_dark1_normal">
</td>
<td class="table_button_bullet_gap_dark1_normal" onmouseover="ddrivetip('Open Work-Order');"  onmouseout="hideddrivetip();"/>
<span class="table_button_bullet_input_dark1_normal"> WO </span>
</td>
<td class="table_button_bullet_tail_dark1_normal" onmouseover="ddrivetip('Open Work-Order');"  onmouseout="hideddrivetip();"/>
 
</td>
</tr>
</table>
</form> 

Yes there is only one menuitem_home. Did something recently change where you MUST call submit by the form ID?

Not as far as I know, but using the ID and getElementById would be a preferred/more proper way of doing it anyway.

 

 

also, this has a really odd consequence in that form targets to new windows wont work. 

 

Calling .submit() does not cause the onsubmit event to be executed.  You have to run that code manually prior to calling the .submit function.

 

 

Calling .submit() does not cause the onsubmit event to be executed.

 

On the contrary, it does (jQuery):

 

.submit( handler(eventObject) ) Returns: jQuery

Description: Bind an event handler to the "submit" Javascript event, or trigger that event on an element.

 

http://api.jquery.com/submit/

Edited by haku

It shows you on the jQuery page.

http://api.jquery.com/submit/

 

I didn't read the whole thread, I'm just clarifying that one point. It says right at the top:

This method is a shortcut for .bind('submit', handler) in the first variation, and .trigger('submit') in the third.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.