airbus Posted August 28, 2009 Report Share Posted August 28, 2009 Tatad gribu uztaisīt pieteikuma formu, kad ir aizpildīti visi prasītie lauciņi tad paradas poga, bet kad ir viens vai vairāki lauciņi tukši poga neradas Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted August 28, 2009 Report Share Posted August 28, 2009 Kurā brīdī lauciņš skaitās aizpildīts? :) Quote Link to comment Share on other sites More sharing options...
airbus Posted August 28, 2009 Author Report Share Posted August 28, 2009 Kad viņā kaut ko ieraksta Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted August 28, 2009 Report Share Posted August 28, 2009 Piemēram, šitā: function check_all(){ if(document.getElementById('l1').value.length * document.getElementById('l2').value.length * document.getElementById('l3').value.length * document.getElementById('l4').value.length){ document.getElementById('p1').style.display = ''; } else { document.getElementById('p1').style.display = 'none'; } } ... <input id="l1" name="lauks1" type="text" onchange="check_all()"> <input id="l2" name="lauks2" type="text" onchange="check_all()"> <input id="l3" name="lauks3" type="text" onchange="check_all()"> <input id="l4" name="lauks4" type="text" onchange="check_all()"> <input id="p1" name="poga1" type="button" style="display : none"> ... Quote Link to comment Share on other sites More sharing options...
airbus Posted August 28, 2009 Author Report Share Posted August 28, 2009 Parse error: syntax error, unexpected '=' in C:\xampp\htdocs\mon\creat.php on line 12 12rinda document.getElementById('p1').style.display = ''; Quote Link to comment Share on other sites More sharing options...
mefisto Posted August 28, 2009 Report Share Posted August 28, 2009 Tas ir javascript nevis php. ::facepalm:: Quote Link to comment Share on other sites More sharing options...
airbus Posted August 28, 2009 Author Report Share Posted August 28, 2009 Ā php formata nevarat iedot kāds? Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted August 28, 2009 Report Share Posted August 28, 2009 (edited) airbus --> a kam tev PHP formataa?? ja pogas nebuus kaa tad nosuutiisi Serverim lol Edited August 28, 2009 by Grey_Wolf Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted August 28, 2009 Report Share Posted August 28, 2009 Airbus... Aber lūdzu: <?php echo <<< AIRBUS_4EWA function check_all(){ if(document.getElementById('l1').value.length * document.getElementById('l2').value.length * document.getElementById('l3').value.length * document.getElementById('l4').value.length){ document.getElementById('p1').style.display = ''; } else { document.getElementById('p1').style.display = 'none'; } } ... <input id="l1" name="lauks1" type="text" onchange="check_all()"> <input id="l2" name="lauks2" type="text" onchange="check_all()"> <input id="l3" name="lauks3" type="text" onchange="check_all()"> <input id="l4" name="lauks4" type="text" onchange="check_all()"> <input id="p1" name="poga1" type="button" style="display : none"> ... AIRBUS_4EWA; ?> Quote Link to comment Share on other sites More sharing options...
Web Developer Posted August 28, 2009 Report Share Posted August 28, 2009 Vēl vari izmantot AJAX. Bet skaties, kurš risinājums ir ātrāks. Būtībā tas ir tikai dekoratīvs elements, jo iesniegt formu tāpat var - ar vai bez pogas - to ļoti vienkārši ir nokārtot. Jebkurā gadījumā visas nepieciešamās pārbaudes ir jāveic servera pusē. JavaScript tu vari vienkārši klientu ērtības labad un trafika atvieglošanai veikt pārbaudes... Quote Link to comment Share on other sites More sharing options...
mefisto Posted August 28, 2009 Report Share Posted August 28, 2009 Emm ... tu tiešām domā , ka cilvēks, kurš neatšķir JS no PHP, ir spējīgs uzrakstīt jebko, kas izmantotu XHR ?! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.