daviskrex Posted June 17, 2007 Report Share Posted June 17, 2007 Mēģināju uztaisīt reģistrācijas lapu bet apsēdos uz tā, ka nevarēju izdomāt kā lai nospiežot submit automātiski pārbauda trīs lodziņus. Tipa ja kāds no viņiem ir tukš tad nelaiž tālāk. Mēģināju visādi nesanāca. Link to comment Share on other sites More sharing options...
hackerman Posted June 17, 2007 Report Share Posted June 17, 2007 (edited) if(empty($_POST['logs1']) && empty($_POST['logs3']) && empty($_POST['logs3'])){ echo "error"; } Var jau katru atsevišķi ar :) Edited June 17, 2007 by hackerman Link to comment Share on other sites More sharing options...
andrisp Posted June 17, 2007 Report Share Posted June 17, 2007 hackerman, nepareizi. Tavā variantā es varu droši nosutīt tikai vienu lauku. Pārbaudīt vajag ar || nevis && Link to comment Share on other sites More sharing options...
hackerman Posted June 17, 2007 Report Share Posted June 17, 2007 Ops, atvainojos. Link to comment Share on other sites More sharing options...
localhero Posted June 17, 2007 Report Share Posted June 17, 2007 (edited) Nu var jau pirms PHP ar javascriptu nokjert "godigos" lietotaju kas vienkarsi aizmirsusi aizpildit. function formas_validacija ( ) { valid = true; if ( document.forma.vards.value == "" ) {alert ( "Aizpildiet ludzu lauku Vards" ); valid = false; } if ( document.forma.uzvards.value == "" ) {alert ( "Aizpildiet ludzu lauku Uzvards" ); valid = false; } if ( document.forma.iesauka.value == "" ) {alert ( "Aizpildiet ludzu lauku iesauka" ); valid = false; } return valid; } pie un ieliec lai submitejot parbauda. Un pec tam vel ar PHP lai parbauda. Ietaupisi resursus. Edited June 17, 2007 by localhero Link to comment Share on other sites More sharing options...
daviskrex Posted June 17, 2007 Author Report Share Posted June 17, 2007 paldies. u da best. :) Link to comment Share on other sites More sharing options...
Recommended Posts