Array operation

K

Kuna

Hi All,

I am having problem in implementing array operation in my task these
are:

In my form I have some multiple entry fields which are showing in a row
and below that I have an Add button which will add the rows again in
the form which I have done by incrementing the value but for deleting
the rows I have a check box and when selecting the check box and
hitting delete button it suppose to delete the rows which I had
selected and I am just taking an array and keeping the values in the
array to not shoe the selected row after delete button. But the problem
is that delete is working as it need to work when I am going to save
the form data then it was having the deleted values in the array and
showing the fields again. So what will I do for solve this problem
please suggest me. Here is the code I have used for the array storing
purpose:

<code>
our @rows = qw(); # this is the array I have declared globally for the
entire form.

====
if ( $var eq 'delete' || $var eq 'add' ) {
push (@rows,"$checkid");
}
$number_of_rows = @rows; # it is checking for the check box click and
push those rows to the array.
====

$is_download=0;
for (my $u=0; $u < $number_of_rows; $u++)
{
if ($rows[$u] eq $i)
{
$is_download=1;
last;
}
}
if ( $i eq $checkid || $is_download eq 1 ) {
}
else {

#The form goes here

}
</code>
 
B

Brian McCauley

I am having problem

[ snip: suspected stealth-CGI question with confusing description and
very little, (and quite possibly, not relevant) code ]

Please produce a _minimal_ but _complete_ (strict, warning-free) script
that you have actually run and found to illustrtate your question. This
and much other helpful advice can be found in the posting guidelines.

Random-shot-in-the-dark: You are forgetting CGI.pm is sticky be
default.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top