Klokjis Posted September 13, 2005 Report Share Posted September 13, 2005 reku lieta taada, ka vajag taa ka ir iespeeja izveeleeties 1 no 4 radio buttoniem, bet tad ja izveelas 3 un 4, vajag buut iespeejai ieraxtiit kaut ko text liinijaa, bet tad kad ir value 1 vai 2, tad text liinijaa neko nevar ieraxtiit... <input type="radio" name=":)" value="1"> <input type="radio" name=":)" value="2"> <input type="radio" name=":)" value="3"> <input type="radio" name=":)" value="4"> <input type='text' name='texc'> Link to comment Share on other sites More sharing options...
fassko Posted September 13, 2005 Report Share Posted September 13, 2005 uzveido Javascript, kas ar taimautu pārbauda laukus un ja ir 3 vai 4, tad lauka atribūts disabled = false, citādi true. Protams, var arī uz onclick 3 un ceturtajam radio buttonam eneiblot to teksta lauku. Slinkums bija rakstīt jau gatavu Javascriptu :P Domā pats! Link to comment Share on other sites More sharing options...
Delfins Posted September 13, 2005 Report Share Posted September 13, 2005 ne vis onclick, bet onchange! Link to comment Share on other sites More sharing options...
Klokjis Posted September 13, 2005 Author Report Share Posted September 13, 2005 a kaa iznaak ar enable un disabe... texta laukam noraadiit - if ... 3 vai 4 {enable}, else {disable}? Link to comment Share on other sites More sharing options...
bubu Posted September 14, 2005 Report Share Posted September 14, 2005 1) name līks, tādu nezinu vai vispār var referencēt no javaskripta. 2) vai radio buttons ir ieķeksēts vari pārbaudīt šādi: if (document.forms[0].radio_name.value == "3") { // ieķeksēts ir 3-šais } Link to comment Share on other sites More sharing options...
Grey_Wolf Posted September 14, 2005 Report Share Posted September 14, 2005 kaa jau bubu mineja - name ir galiigi garaam - izmantoti 2 netljautie simboli - pat trakaak vieniigi tie :( name - velams sakties ar latinju burtu - A-Z a-z javascripts atskir lielos un mzos burtus ( A != a ) nosaukumos/mainigajos vajadzeetu izmantot latinju simbolus a-z 0-9 un kaa atdaliitaaju _ nekaadaa gadiijumaa iekavas/peedinjas/punktus/komatus utt.. Link to comment Share on other sites More sharing options...
Klokjis Posted September 14, 2005 Author Report Share Posted September 14, 2005 nu tas name ir tikai piemeers... es webaa nelikshu ":)" Link to comment Share on other sites More sharing options...
Klokjis Posted September 17, 2005 Author Report Share Posted September 17, 2005 (edited) njaa, mosh kaads vareetu pateikt kaa vajadzeetu izlabot to enable/disable dalju?! <? echo '<input type="radio" name="vot" value="1"'; if (isset($_POST['vot']) && ($_POST['vot']) == "1") { echo 'checked'; }; echo '>'; echo '<input type="radio" name="vot" value="2"'; if (isset($_POST['vot']) && ($_POST['vot']) == "2") { echo 'checked'; }; echo '>'; // ... 3,4 arii taa pat. ?> ... <? echo '<input type="text" name="tekstaaile" maxlength="100" value="'.$_POST['tekstaaile'].'"'; if (document.forms[0].vot.value == "3") {echo 'enable'} elseif (document.forms[0].vot.value == "4") {echo 'enable'} else {echo 'disable'}; // kljuuda ir tajaa, ka te ir javascripta komponenti PHPaa... a kaa uzraxtiit JSaa? nav naacies JS mociit... echo ' />' ?> Un shitaa if var izpildiit, ja noraada == 'value'. Kjipa taa: if ($_POST['vot'] == '1' || $_POST['vot'] == '2' ) {echo 'pam param';}; Edited September 17, 2005 by Klokjis Link to comment Share on other sites More sharing options...
Klokjis Posted September 17, 2005 Author Report Share Posted September 17, 2005 plz. anybody?! Link to comment Share on other sites More sharing options...
Recommended Posts