Jump to content

[SOLVED] Object doesn't support property or method???


efficacious

Recommended Posts

Hi all,

 

Getting this error:

Object doesn't support property or method

 

My code:

<script>
function GetEmpDetails()
{
document.getElementById('TheForm').action='EmpHours.php';
document.getElementById('TheForm').submit();
}
</script>

 

form code:

<form id='TheForm' name='TheForm' action='../Ca_info/Ceh_info.php' method='post'>

 

thanks for you help,

 

`eff

ok This is seriously screwed up..

 

I did a test page to see if it was just a syntax error or what..

 

But bare bones I threw

 

<script>
function GetEmpDetails()
{
alert(document.getElementById('MyForm').action);
}
</script>

 

then I put in

 

<form id='MyForm' action='mypage.php' method='post'>
<select name='Select' onchange='GetEmpDetails();'>
<option value='1'>Opt1</option>
<option value='2'>Opt2</option>
</select>
</form>

 

RESULTS IN:

mypage.php

 

 

why will it work there but then on my page I get [Object] as my result????

 

The only difference between above script and myne is that myne in echoed out to the page through php?

But the html looks fine in ViewSource so whats the problem?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.