hi ...
i am workin on php usin Postgresql in linux
I hav created a text box and two buttons name MORE and FEWER...
The Function of MORE : Everytime i will click it ... it should create a row havin combo box and text box
The Function of FEWER : Everytime i will click it ... it should delete one row havin combo box and text box from the web page...
i hav used java scripts
the code is as follows :-
Quote:
function addRow(frmCriteria)
{
var tmp = frmCriteria.sub_cnt.value;
tmp++;
frmCriteria.sub_cnt.value = tmp;
frmCriteria.action = "cutoff.php?group="+frmCriteria.grp_id.value;
}
function removeRow(frmCriteria)
{
if( frmCriteria.sub_cnt.value > 1)
{
var tmp = frmCriteria.sub_cnt.value;
tmp--;
frmCriteria.sub_cnt.value = tmp;
frmCriteria.action = "cutoff.php?group="+frmCriteria.grp_id.value;
}
else
{
return false;
}
}
|
when i am executin it its not gettin executed...
the code in side form tag is :-
Quote:
<form name="criteria_frm" action="cutoff_act.php?group=$group" method="POST">
<input type="hidden" name="grp_id" value="<?php echo $group;?>">
**<input type="hidden" name="sub_cnt" value=?? > // i dnt knw how to show the changed value of created and deleted rows here
<input type="submit" onclick="return addRow(document.criteria_frm)" value="More">
<input type="submit" onclick="return removeRow(document.criteria_frm)" value="Fewer">
|
is there any problem with the code...
Waitin for the Reply...