efficacious Posted September 24, 2008 Share Posted September 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 24, 2008 Share Posted September 24, 2008 You are? How are you calling the function? Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 calling with: <select name='Employee' onchange='GetEmpDetails()' > Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 hmm it won't even let me post it.. geezuz onchange='GetEmpDetails()' Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 o-n-c-h-a-n-g-e-=-'-G-e-t-E-m-p-D-e-t-a-i-l-s-(-)-;-'- lol only way it would post for me Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 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? Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 omg this is driving me crazy... I put the test through every conceivable thing so that it matches the other page. SAME FRIKIN RESULT... Works on testing.php but not on EmpHours.php Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 Bump... I'm at a dead stop until this is resolved.. Thankz Lets hear some ideas... anything.... There has got to be a reason this is doing this. Quote Link to comment Share on other sites More sharing options...
efficacious Posted September 24, 2008 Author Share Posted September 24, 2008 THIS TOPIC IS SOLVED THE ERRORS HERE ARE CONTRIBUTED TO A SERIOUS JS FLAW Visit this topic for further info: http://www.v7n.com/forums/coding-forum/100116-js-form-wackjob.html Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 25, 2008 Share Posted September 25, 2008 Well there you go, yeah I was confused because I tested you code on a blank page and it worked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.