Object doesn't support this object in javascript

within the same page that i provided…i don’t have a access to give you for the link.sorry.

Well currently when clicking on the ticket number, it tries to load a new page. Is that how your problem is experienced, and is it expected for the ticket number to try and load a new page?

my problem lies in the dropdown box…
will give you the next page if it is successful…


<html>
<head>
	<script src="jquery/jquery.min.js"></script>
	<script type="text/javascript" src="jquery/jquery.validate.js"></script> 
	<script>
		$(document).ready(function(){
			$.validator.addMethod("noSpecialChars", function(value, element) {
				  return this.optional(element) || /^[a-z0-9\\_]+$/i.test(value);
			  }, "<br/><font size='3' color='#FF0000'>Username must contain only letters, numbers, or underscore.</font>");
			$("#msg").validate({
			  rules: {
			  description:"required",
				severity:"required"
				
			 }
			});
		});
	</script>
<script>
function textCounter(field, countfield, maxlimit)
{
  if (field.value.length > maxlimit)
    field.value = field.value.substring(0, maxlimit);
  else 
    countfield.value = maxlimit - field.value.length;
}
function textcount(field,mlimit)
{
  field.value = field.value.substring(0, mlimit);
}
</script>
	<style>
.Wordwrap

{
width: 300px;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */

}
</style>
</head>
<body onload="document.msg.description.focus();">

<table  BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="80%"  align='center'>
<tr>
	<td width="100%" align="left" valign="middle">
	<img src='img/assignto.png'>
	</td>
</tr>

<td width="100%" align="center" >
<table align='center' BORDERCOLOR="#0B0B0B">
<form  name='msg' id='msg' action='asstoticket.php' method='post'  enctype="multipart/form-data">
	<table  align='center'>

	<input type='hidden' value='JoshA' name='assto'>
	<input type='hidden' value='User' name='cby'>
	
		<tr>
			<td><strong><label>Ticket No : </label></strong>110622004	</td>	
		</tr>
		<tr>
			<td><strong><label>Create By : </label></strong>User	</td>
			<td><b>Assign to : </b>JoshA</td>			
		</tr>
		<tr>
			<td><strong>Date Create : </strong>06/22/2011  4:21PM</td>
			<td><strong>Date to be Assign: </strong>2011-06-27</td>
		<tr>
		<tr>		
			<td><strong>Category : </strong>PC</td>
			<td><strong>Sub-Category : </strong>Application</td>
		</tr>
		<tr>
			<td>
				<strong>File Attachment : </strong>
							</td>
		<td><b>Severity :</b> </td>		
		</tr>
			
		<tr><td class='Wordwrap'><strong>Description : </strong>my sampoke</td></tr>	
	
<tr><td align='left'><b>Attach File :</b><br/><input size='10' align='left'  type='file' name='images'>Max File Size 2mb</td></tr>
<br/>
<table class='main' width='50%' BORDERCOLOR="#0B0B0B" align="center" frame='Box'>
<br/>
<b>Messages:</b>
<tr>
	<td colspan="4">
		   <div style="height: 200px; overflow: auto; border: 1px solid black;">
				</div>
	</td>

</tr>
</table>
<table  align='center'>
<tr>
	<td>
	<tr>
	<td align='left'><b>Comment's/Solution <font color=red>*</font> :</td>
	</tr>
	<tr>
		<td align='left'><textarea rows="7" cols="50" name="description" onKeyDown="textCounter(this.form.description,this.form.remLen,500);" onKeyUp="textCounter(this.form.description,this.form.remLen,500);" >
		</textarea><br><input readonly type=text name=remLen size=3 maxlength=3 value="500"> characters left.</font></td>
	</tr>
	
	<tr>
	<td align='left'>
		<input type='submit' value='Submit' name='Save'  onClick="javascript: var x=window.confirm('Assign this ticket to JoshA?');if (!x) return(false);" title='Submit a Message'>
		<input type='Reset' value='Reset' name='reset' title='Reset'>
	</td>
	</tr>
</td>	
</tr>	
	</table>

</form>

<br/>
</tr>
</td>
</table>	
</body>
</html>
	




Thanks. The problem is that this code expect one form element with a name of “transfer”

document.forms['transfer'].submit();

but the page contains many different forms with a name of “transfer”. Each of those Action dropdowns is a separate and different form with the name of “transfer”, so JavaScript returns a nodelist that contains multiple forms.

The good news is that you have used the standard event association technique to associate the function to the forms.


trans[y].onchange = Transferticket;

That’s good, because the Transferticket function will be invoked with the this keyword referring to the element that triggered the event, which just-so-happens to be the form that you’re after.

So, instead of that documents.forms[‘transfer’] code, you should be able to instead use the this keyword to trigger the submit event for the appropriate form:


this.submit();

Hi,

I have change my code documents.forms[‘transfer’] to this.submit(); but still the old error appear on the browser “Object doesn’t support this property or method”

On further investigation, it seems that you are also using inline event handlers, which have no useful this keyword for their context.

I see that you’ve passed the this keyword to the function as a jQuery wrapped value, so something like this should work:


sVal.parents('form').submit();

and likewise for the similar function that uses uVal

Hi,

It works…Thanks for your help…