Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js] przy zmianie option pojawiajace sie input
rzseattle
post
Post #1





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

Ostrzeżenie: (0%)
-----


Chodzi mi cos takiego ze w select mam dwie wartosci "Watch action" i "Watch user", no i chce zeby przy zmianie wartosci na "Watch action" pojawialy mi sie 2 inputy (tekst) "action" i "module" a przy wyborze "Watch user" 1 pole "user"

Da sie wogole cos takiego zrobic??
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
FiDO
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 717
Pomógł: 0
Dołączył: 12.06.2002
Skąd: Wolsztyn..... Studia: Zielona Góra

Ostrzeżenie: (0%)
-----


No co Ty... nawet gotowe zupki z paczki trzeba zalac woda (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)



---
ok... hint (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
[xml:1:d22274ba15]<script type="text/javascript">
function zmien(frm)
{
obj1 = frm.pole1.parentElement.parentElement;
obj2 = frm.pole2.parentElement.parentElement;

if (obj1.style.display == 'none')
{
obj1.style.display = 'block';
obj2.style.display = 'none';
}
else
{
obj1.style.display = 'none';
obj2.style.display = 'block';
}
}
</script>
<form >
<table border="1" cellpadding="2" cellspacing="0" >
<tr>
<td>
<select name="wybor" size="1" onchange="zmien(this.form);">
<option value="1">Cos tam</option>
<option value="2">Cos tam2</option>
</select>
</td>
</tr>
<tr style="display: block;">
<td>
<input type="text" name="pole1" value="jeden" />
</td>
</tr>
<tr style="display: none;">
<td>
<input type="text" name="pole2" value="dwa" />
</td>
</tr>
</table>
</form>
[/xml:1:d22274ba15]
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 21:00