<script src="http://www.prototypejs.org/javascripts/prototype.js"></script>
<script>
function submitme()
{
$('location').value='';
if($F('location1')!='other' && !$('location2').visible())
{
$('location').value=$F('location1');
$('forma').submit();
}
else if ($F('location1')=='other' && !$('location2').visible())
{
$('location2').show();
alert('izaberi vrednost iz drugog select-a, post ponovo');
}
else if ($F('location1')=='other' && $('location2').visible())
{
$('location').value=$F('location2');
$('forma').submit();
}
return false;
}
</script>
<form action="nesto.php" id="forma" onsubmit="submitme(); return false;">
<input type="hidden" name="location" id="location">
</form>
<select name="location1" id="location1">
<option value="paris">Paris</option>
<option value="newyork">New York</option>
<option value="other">Other</option>
</select>
<select name="location2" id="location2" style="display:none">
<option value="paris1">Paris1</option>
<option value="newyork1">New York1</option>
<option value="other1">Other1</option>
</select>
<button onclick="submitme();">></button>
|