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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.