Hey, I have an edit form (aspx page) which is used to edit an item in a sharepoint list. What I'd like to be able to do is if a drop down box equals "declined" show up an extra field called "Reason".

I've found the following code which does something similar, if the "ShowFields" tick box is checked it shows the fields "Start Date" and "Due Date"

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

<script>
$(document).ready(function()
{
$("input[title$='ShowFields']").click(function()
{
$("input[title$='Title']").parent('span').parent('td').parent('tr').toggle();
$("nobr:contains('Start Date')").parent('h3').parent('td').parent('tr').toggle();
$("nobr:contains('Due Date')").parent('h3').parent('td').parent('tr').toggle();
});
});
</script>

The bit I am unsure of how to do is change it so it works with a drop down box, and when it equals "Declined". I think this is the line I need to change I'm just unsure what it needs changing to!

$("input[title$='ShowFields']").click(function()

The example code was found here: http://akanoongo.blogspot.com/2008/04/how-to-hide-fields-in-sharepoint-list.html

Many Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.