Klokjis Posted November 26, 2005 Report Share Posted November 26, 2005 probleema... ir kjipa ir FORMi: <form name='stunda_1' method='post' action='...'> <input type='text' name='kods' maxlength='5'> <input type='text' name='nosaukums' maxlength='50'> <input type='submit' name='submit_1' value='Akceptēt'> </form> <form name='stunda_2' method='post' action='...'> <input type='text' name='kods' maxlength='5'> <input type='text' name='nosaukums' maxlength='50'> <input type='submit' name='submit_2' value='Akceptēt'> </form> ...stunda_3;4;5...9..... if(($_POST['submit_1'])&&(!$_POST['kods']) || ($_POST['submit_1'])&&(!$_POST['nosaukums']) || ($_POST['submit_2'])&&(!$_POST['kods']) || ($_POST['submit_2'])&&(!$_POST['nosaukums'])... un lieta taada, uzspiezhot submit_1 vinjsh nochekos 'kods', bet vinjsh nochekos gan 1., gan 2. stundai... vareetu to visu taisiit pat taa, ka: <form name='stunda_1' method='post' action='...'> <input type='text' name='kods' maxlength='5'> <input type='text' name='nosaukums' maxlength='50'> <input type='submit' name='submit' value='Akceptēt'> </form> <form name='stunda_2' method='post' action='...'> <input type='text' name='kods' maxlength='5'> <input type='text' name='nosaukums' maxlength='50'> <input type='submit' name='submit' value='Akceptēt'> </form> ...stunda_3;4;5...9..... if(($_POST['submit'])&&(!$_POST['kods']) || ($_POST['submit'])&&(!$_POST['nosaukums'])... bet probleema ir if(($_POST['submit'])&&(!$_POST['kods']) || ($_POST['submit'])&&(!$_POST['nosaukums'])... kaa piem. var noraadiit, lai njem POST veeriibas no form stunda_1 - if(($_POST['submit no form stunda_1'])&&(!$_POST['kods no form stunda_1']) || ... Link to comment Share on other sites More sharing options...
john.brown Posted November 26, 2005 Report Share Posted November 26, 2005 Un kāpēc neielikt katrā formā <input type="hidden" name="stunda" value="1"> (vai 2,3..)? Un tad čeko to stundu... Link to comment Share on other sites More sharing options...
bubu Posted November 26, 2005 Report Share Posted November 26, 2005 Submit pogām savādākus value piešķir. Tos tad value arī nolasi un pārbaudi. Link to comment Share on other sites More sharing options...
Recommended Posts