webdevelopernj
Programmer
I am trying to dynamically create html buttons on the fly. Normally when I call a function after a button is pressed I used code like this:
$query = &restore_parameters($query) if $query->param('action') eq 'EDIT';
The function call above to restore_parameters is a well recognized functions, as it is available over many websites.
my problem is that I want to dynamically create a function call after a search routine is finished.
I successfully created a static call to the restore function by:
$query = &restore_parameters($query,0) if $query->param('action') eq 'EDIT0';
$query = &restore_parameters($query,1) if $query->param('action') eq 'EDIT1';
$query = &restore_parameters($query,2) if $query->param('action') eq 'EDIT2';
I figure I could create this dynamically with $x and a for loop, however the cgi program can't find the function once it is wrapped in the for loop, the for loop works i tested print statement in it, however I believe by being wrapped in conditions it doesn't have the constant exposure on a triggered event, I don't know if i making much sense here but please send me any info you may have.
Here is the for loop I was attempting to work with:
for($g=0;$g<$editFlagSet;$g++) { print $g."<br>";
$query = &restore_parameters($query,$g) if $query->param('action')eq 'EDIT'.$g;
}
Not sure you need this, but here is search function, it sets the $editFlagSet variable **************************************************
sub printDBResults {
open(DATAFILE,"searchresults"
while(<DATAFILE>){
s/%([\dA-Fa-f][\dA-Fa-f])/pack("c",hex($1))/eg;
@temp = split /\n/;
foreach $tem (@temp) {
@seperate = split /:/;
#foreach $sep (@seperate) {
if ($seperate[0]){
$defaultname = $seperate[0];
$addToDefaultname = $defaultname . '_understood.txt';
print " ";
print $query->textfield('savefile'.$tempNum,$addToDefaultname,'17'),"&nb
sp; ";
print $query->submit('action','EDIT'.$editNum),"<br>";
$editFlagSet++;
$tempNum++;
$editNum++;
}
}
}
close(DATAFILE);
print "<br><br><a href=javascript:goBack()>New Search</a><br>";
#createEditButtons();
exit 0;
}
$query = &restore_parameters($query) if $query->param('action') eq 'EDIT';
The function call above to restore_parameters is a well recognized functions, as it is available over many websites.
my problem is that I want to dynamically create a function call after a search routine is finished.
I successfully created a static call to the restore function by:
$query = &restore_parameters($query,0) if $query->param('action') eq 'EDIT0';
$query = &restore_parameters($query,1) if $query->param('action') eq 'EDIT1';
$query = &restore_parameters($query,2) if $query->param('action') eq 'EDIT2';
I figure I could create this dynamically with $x and a for loop, however the cgi program can't find the function once it is wrapped in the for loop, the for loop works i tested print statement in it, however I believe by being wrapped in conditions it doesn't have the constant exposure on a triggered event, I don't know if i making much sense here but please send me any info you may have.
Here is the for loop I was attempting to work with:
for($g=0;$g<$editFlagSet;$g++) { print $g."<br>";
$query = &restore_parameters($query,$g) if $query->param('action')eq 'EDIT'.$g;
}
Not sure you need this, but here is search function, it sets the $editFlagSet variable **************************************************
sub printDBResults {
open(DATAFILE,"searchresults"
while(<DATAFILE>){
s/%([\dA-Fa-f][\dA-Fa-f])/pack("c",hex($1))/eg;
@temp = split /\n/;
foreach $tem (@temp) {
@seperate = split /:/;
#foreach $sep (@seperate) {
if ($seperate[0]){
$defaultname = $seperate[0];
$addToDefaultname = $defaultname . '_understood.txt';
print " ";
print $query->textfield('savefile'.$tempNum,$addToDefaultname,'17'),"&nb
sp; ";
print $query->submit('action','EDIT'.$editNum),"<br>";
$editFlagSet++;
$tempNum++;
$editNum++;
}
}
}
close(DATAFILE);
print "<br><br><a href=javascript:goBack()>New Search</a><br>";
#createEditButtons();
exit 0;
}