/    Sign up×
Community /Pin to ProfileBookmark

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

For some reason onClick or onChange are not working. I have copied this code form another page I have which works perfectly. Any ideas why it isnt working here?

[code=html]<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>[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzJun 22.2006 — You've got improper element nesting there. Try this:
&lt;td&gt;&lt;form name='archived' method='post' action='/admin/vacancyListing.php'
style='margin:0;'&gt;&lt;div&gt;
&lt;input type='hidden' name='job_id' value='8'&gt;
&lt;select name='visible' onChange='document.archived.submit();'&gt;
&lt;option value='yes' class='pending' selected&gt;Yes&lt;/option&gt;
&lt;option value='no' class='approved'&gt;No&lt;/option&gt;
&lt;/select&gt;&lt;/div&gt;&lt;/form&gt;&lt;/td&gt;

If it doesn't work, we'll need to see more code.

Be sure to [b]read[/b] these too:

[url=http://weblog.burningbird.net/archives/2005/03/25/the-importance-of-degrading-gracefully/]The Importance of Degrading Gracefully[/url]

[url=http://domscripting.com/blog/display.php/25]Perpetuating the myths of JavaScript degradation.[/url]
Copy linkTweet thisAlerts:
@mameha1977authorJun 22.2006 — I tried that but no luck.

Its weird because as I say I copied it from another very similar page where it works OK.

Anyway here is a dump of the generated HTML:

[code=html]<html>
<head>

<title>www.XXX.com - Admin - Job Vacancies</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en-gb" />
<link href="styles/adminLayout.css" rel="stylesheet" type="text/css" media="screen">
<link rel="stylesheet" href="styles/admin.css" type="text/css" media="screen">

<link href="styles/menu.css" rel="stylesheet" type="text/css" media="screen">
<link href="styles/forms.css" rel="stylesheet" type="text/css" media="screen">
</head>
<body>
<div id="headerL"><h3>XXX WEB CMS</h3><p>Content Management System for the XXX International Website.</p></div><div id="headerR"> <p>User: <span class="info">KOREA ADMIN</span> <br/><a href="popup_accesslevels.php" onClick="return popup(this, 'access levels')">Access level: <span class="info">6</span></a> <br/>Country Privileges: <span class='notEditable'>UK</span> <span class='notEditable'>US</span> <span class='notEditable'>AU</span> <span class='notEditable'>DE</span> <span class='notEditable'>FR</span> <span class='editable'>KO</span> <span class='notEditable'>MA</span> <span class='notEditable'>SI</span> <span class='notEditable'>CH</span> </p></div><div id="flush"></div><div id="navigation"> <div id="nav-menu"><ul><div class="menuHeading">General</div><li><div class="menuItem"><a href="index.php" title="Home">Home</a></div></li>
<li><div class="menuItem"><span class='grey'>Web Stats</span></div></li>
<div class="menuHeading">User Management</div><li><div class="menuItem"><a href="contactListing.php" title="Contact Requests">Contact Requests</a></div></li>
<li><div class="menuItem"><span class='grey'>Users Admin</span></div></li>
<div class="menuHeading">Content Manager</div><li><div class="menuItem"><a href="newsAdmin.php" title="News Articles">News Articles</a></div></li>
<li><div class="menuItem"><span class='grey'>News Types</span></div></li>
<li><div class="menuItem"><a href="vacancyListing.php" title="Job Vacancies">Job Vacancies</a></div></li>
<div class="menuHeading">Translations</div><li><div class="menuItem"><a href="translationsAdmin.php" title="Edit Translations">Edit Translations</a></div></li>
<div class="menuHeading">Navigation</div><li><div class="menuItem"><a href="../index.php?action=log_out">Sign-Out</a></div></li><li><div class="menuItem"><a href="../index.php">XXX.com</a></div></li> </ul></div></div>

<div id="mainContent">
<div id="contentHeader">Job Vacancies</div>

<p style="padding:0px;margin:0px"><span class='note'>(Only content relating to the countries you are authorised to edit is displayed.)</span></p>


<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<form action="/XXX/admin/vacancyListing.php" method="post" name="search">
<td>
<input type="text" name="searchString" value="" class="blur" size="30" maxlength="100" onFocus="this.className='focus'" onBlur="this.className='blur'" /><input type="submit" name="search" value="Search" class="smalltext" /> </td>
</form>
<form action="/XXX/admin/vacancyListing.php" method="post" style="padding:0px;margin:0px">
<td>
<input type="submit" name="nonsearch" value="Show All Records" class="smalltext" /> </form>
</td>
<form action="vacancyModify.php" method="post" name="addNewRecord">
<td><input type="submit" name="add" value="Add New Record" class="smallText" /></td>
</form>
<td nowrap >
<p class='key'>KEY:<br/>
<span class='approved'>Green Text</span> - This condition has been satisfied.<br/>
<span class='pending'>Red Text</span> - This condition is preventing the article being displayed.
</p>
</td>
</tr>

<tr height="30">
<td align="left" colspan="2" style="font-size:0.9em">
2 records </td>

</tr>

<tr>
<td width="130" align="left">&nbsp; </td>
<td width="130" align="right">&nbsp; </td>
</tr>
</table>

<div id="formSelection">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr style='background-color:#EEEEEE'>
<td class='colheader'>ID</td>
<!--<td class='colheader' nowrap>Creation Date</td>-->
<!--<td class='colheader' nowrap>Publish Date</td>-->

<!--<td class='colheader' nowrap>Salary</td>-->
<td class='colheader' nowrap>Closing Date</td>

<td class='colheader' nowrap>Archived</td>

<td class='colheader' nowrap>Title</td>
<td class='colheader' nowrap>Description</td>
<td class='colheader' nowrap>Country</td>
<td class='colheader' align="center" colspan="2"><b>Options</b></th>
</tr>
<tr><td colspan=9 style='background-color:#000000'></td></tr>
<td>10</td>
<td><span class="approved">2006-09-21</span></td>
<td><form name='archived' method='post' style='margin:0;'><div>
<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>
</div>
</form></td>
<td>Korean Assistant</td>
<td>hjksad hjk dsahjk dhsjka ndsau</td>
<td>KO</td>
<form action="vacancyModify.php" method="post">
<input type="hidden" name="pageNo" value="1" /><input type="hidden" name="view" value="" checked /><input type="hidden" name="searchString" value="" checked /><input type="hidden" name="job_id" value="10" /><td width='30'><input type="submit" name="modify" value="Modify" class="smallText" /></td>
</form>
<form action="vacancyListing.php" method="post">
<input type="hidden" name="job_id" value="10" /><input type="hidden" name="pageNo" value="1" /><input type="hidden" name="view" value="" checked /><input type="hidden" name="searchString" value="" checked /><td width='30'><input type="submit" name="delete" value="Delete" class="smallText" onClick="checkDelete(); return delete_ok;" /></td>
</form>
</form>
</tr>
<td>13</td>
<td><span class="approved">2006-10-21</span></td>
<td><form name='archived' method='post' style='margin:0;'><div>
<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>
</div>
</form></td>
<td>korea111</td>
<td>sssssss</td>
<td>KO</td>
<form action="vacancyModify.php" method="post">
<input type="hidden" name="pageNo" value="1" /><input type="hidden" name="view" value="" checked /><input type="hidden" name="searchString" value="" checked /><input type="hidden" name="job_id" value="13" /><td width='30'><input type="submit" name="modify" value="Modify" class="smallText" /></td>
</form>
<form action="vacancyListing.php" method="post">
<input type="hidden" name="job_id" value="13" /><input type="hidden" name="pageNo" value="1" /><input type="hidden" name="view" value="" checked /><input type="hidden" name="searchString" value="" checked /><td width='30'><input type="submit" name="delete" value="Delete" class="smallText" onClick="checkDelete(); return delete_ok;" /></td>
</form>
</form>
</tr>
</table>
</div>

</div>

<div id="adminFooter">&copy; 2006, <a href="http://www.XXX.com" target="_blank"><img src="../images/XXX_logo.gif" alt="XXX" style="border:none;width:30px"></a>&nbsp;&nbsp;All Rights Reserved.</b></div>

</body>
<!-- JavaScript -->

<script language="Javascript">
<!--

function checkDelete() {
message = "Are you sure that you want to delete?n";
tmp = confirm(message);
if(tmp == true) {
document.delete_ok = true;
} else {
document.delete_ok = false;
}
}

//-->
</script>

</html>

[/code]
×

Success!

Help @mameha1977 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...