Trimite formular la adrese diferite

Coduri intrebari, probleme legate de HTML, XHTML si CSS
soul_reaper
Mesaje:4

Trimite formular la adrese diferite

Salut :D

deci.. sa zicem ca avem 3 file : index.php ,fila1.php si fila2.php

in fiecare fila exista o functie de cautare simpla ,in genul de mai jos

Cod: Selectaţi tot

<form method="get" action="fila1.php">
<input type="text" name="search" value="">
<input value="Search" type="submit">
</form>

<form method="get" action="fila2.php">
<input type="text" name="search" value="">
<input value="Search" type="submit">
</form>
vreau sa le pot combina si sa le integrez in index, sa pot selecta in care dintre aceste file pot cauta ceea ce doresc ,sa selectez daca imi cauta in fila1.php sau in fila2.php (fara javascript)

Sper sa ma fi facut inteles
Orice idee e binevenita
Merci

MarPlo Mesaje:4343
Salut
Fara JavaScript se poate adaugand cate un buton pt. fiecare adresa, si folosind atributul formaction="fisier.php" (adaugat nou in HTML5).

Cod: Selectaţi tot

<form method="get" action="fila1.php">
<input type="text" name="search" value="">
<input value="Search"  type="submit">
<input value="Search Fila 2" formaction="fila2.php" type="submit">
<input value="Search Fila 3" formaction="fila3.php" type="submit">
</form>
Iar cu JavaScript, asa:

Cod: Selectaţi tot

<form method="get" action="fila1.php">
<input type="text" name="search" value="" /><br/>
Cauta in: <select onchange="this.form.action=this.value">
 <option ="value="fila1.php">Fila 1</option>
 <option ="value="fila2.php">Fila 2</option>
 <option ="value="fila3.php">Fila 3</option>
</select>
<input value="Search"  type="submit" />
</form>

Subiecte similare