javascript: onChange='document.archived.submit();' problem

This is a discussion on "javascript: onChange='document.archived.submit();' problem" within the JavaScript Forum section. This forum, and the thread "javascript: onChange='document.archived.submit();' problem are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 22nd, 2006, 01:09
New Member
Join Date: Jun 2006
Location: japan
Age: 31
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
javascript: onChange='document.archived.submit();' problem

Ive spent hours trying to fix this annoying problem.

I have some code the shows a dropdown list. When you select an item, the page reloads via javascript so as to save the selection. This code works perfectly on one page, but when I copy it into another page it stops working.

This is the code:

HTML: Select all
<form name='archived' method='post' action='/admin/vacancyListing.php'>
        <td>
        <input type='hidden' name='job_id' value='8'>
        <select name='visible' onChange='document.archived.submit();'>
            <option value='yes' class='pending' selected>Yes</option>
            <option value='no' class='approved'>No</option>

        </select>
        </td>
        </form>


Any ideas what might be wrong?
Reply With Quote

  #2 (permalink)  
Old Jun 22nd, 2006, 19:13
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: javascript: onChange='document.archived.submit();' problem

Is your form name='archived' on every page?
Reply With Quote
  #3 (permalink)  
Old Jun 22nd, 2006, 23:40
New Member
Join Date: Jun 2006
Location: japan
Age: 31
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: javascript: onChange='document.archived.submit();' problem

on the other pages it is archived0 or something. theres some counter being appended to the form. i took it out as it seemed pointless and it wasnt working anyway with that.
Reply With Quote
  #4 (permalink)  
Old Jun 23rd, 2006, 09:57
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: javascript: onChange='document.archived.submit();' problem

Because of the way your JavaScript is written, it will only work if the form has the same name on every page.

Otherwise you will get a meesage something like: 'Object missing'.
Reply With Quote
Reply

Tags
javascript, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] popup and document.write problem in IE deluxmilkman JavaScript Forum 3 Oct 3rd, 2007 11:26
Opening a document using javascript gentlefoot Starting Out 5 Sep 16th, 2007 21:10
document.getElementById and document.getElementByName is not working in FF dhineraj JavaScript Forum 3 Jul 26th, 2007 20:23
How do I stop this javascript document referrer page from coming up? trakarkitekt JavaScript Forum 4 Apr 4th, 2007 02:12
new problem. document.getElementById().width returning unassigned. why? sanchopansa JavaScript Forum 2 Jul 22nd, 2006 20:23


All times are GMT. The time now is 05:55.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43