Selectbox show input filed

Hello,

I have this code:

<script> 
	function checkForOther(obj) 
	{ 
		if (!document.layers) 
		{ 
			var txt = document.getElementById("otherTitle"); 
			if (obj.value == "new") 
			{ 
				txt.style.display = "inline"; 
				// gives the text field the name of the drop-down, for easy processing 
				txt.name = "selTitle"; 
				obj.name = ""; 
			} 
			else 
			{ 
				txt.style.display = "none"; 
				txt.name = ""; 
				obj.name = "selTitle"; 
			} 
		} 
	} 
</script> 

it’s should hide/show input field accourding the user choice - if he choose “<option value=‘new’>new</option>”, the follow action should happend:

				<li id='otherTitle'>
					<label for='new'>new artist</label>
					<input type='text'  name='new_artist_name' />				
				</li>

The script works, but when I click “submit” the parameter that the “select box” should send don’t get send…

here is the full code:


				&lt;li&gt;
					&lt;label for='artist'&gt;Artists&lt;/label&gt;
					&lt;select name='artist_id' onchange=\\"checkForOther(this)\\"&gt;
						&lt;option value='new'&gt;new artist&lt;/option&gt;";
						$query = mysql_query("SELECT id, name FROM `chords_artists` ORDER BY `name` ");
						while($index = mysql_fetch_array($query)) 
						{	
							$artist_id = $index['id'];
							$artist = $index['name'];
							echo "&lt;option value='$artist_id'&gt;$artist&lt;/option&gt;";
						}
						
					echo "	
					&lt;/select&gt;
				&lt;/li&gt;	
				
				&lt;li id='otherTitle'&gt;
					&lt;label for='new'&gt;new artist:&lt;/label&gt;
					&lt;input type='text'  name='new_artist_name' /&gt;				
				&lt;/li&gt;


Can you please help me with it?

Can you please furnish us with a test page? We can use that to figure out what issue is, and then with a solution we can feed that back in to the code itself.