Raiviic Posted October 13, 2007 Report Share Posted October 13, 2007 ir txt fails ar 5 nosaukumiem: 1 2 3 4 5 ir JS risinajums: <script LANGUAGE="JavaScript"> <!-- function gotos(ind) { if (ind==1) { window.location="adrese"; } if (ind==2) { window.location="adrese"; } if (ind==3) { window.location="adrese"; } if (ind==4) { window.location="adrese"; } if (ind==5) { window.location="adrese"; } } //--> </SCRIPT> un pats drop-down html koda: <SELECT NAME="aaa" onchange="gotos(aaa.selectedIndex);" style="border-style: dotted; border-width: 1; background-color: #C0C0C0> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> </SELECT> vajadzetu kkadu smuku risinajumu lai no txt faila iedabutu attiecigo listi kura paraditos drop-down sarakstaa nevis shadi kad jaraksta ar roku - ta liste ir dinamiski mainiga Link to comment Share on other sites More sharing options...
Vebers Posted October 13, 2007 Report Share Posted October 13, 2007 (edited) <?php $f = file('failts.txt'); foreach($f as $idx => $content): ?> <OPTION><?=trim($content);?></OPTION> <?endforeach;?> P.S. http://php.net/file http://php.net/foreach http://php.net/for Edited October 13, 2007 by MakaTaNaw Link to comment Share on other sites More sharing options...
Raiviic Posted October 13, 2007 Author Report Share Posted October 13, 2007 MakaTaNaw tu esi vnk zelts :) tieshi kas vajadzigs un viss strada :) lielumlielais paldies Link to comment Share on other sites More sharing options...
Recommended Posts