Jump to content
php.lv forumi

Vairaaki vienaadi form


Klokjis

Recommended Posts

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

×
×
  • Create New...