Pogledajte određenu poruku
Staro 28. 04. 2010.   #2
cvele
Banned
Knowledge base
 
Avatar cvele
 
Datum učlanjenja: 01.07.2005
Poruke: 1.598
Hvala: 206
140 "Hvala" u 89 poruka
cvele ima spektakularnu aurucvele ima spektakularnu auru
Default

<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>
cvele je offline   Odgovorite uz citat