Not sure if anyone else has run into this problem but the following hidden field code seems to have a bug, either that, or I don't understand what it's supposed to do.
elsif (${$self->{'db_form_len'}}{$field} == -1) { $output .= qq~<input type=hidden name="$field" value="$value_q">$output\n~; }
The final $output is causing all the other fields to repeat over and over and over. I set 8 fields to hidden and 1 minute later, I still had no form, but had loaded over 400k of information. I removed it and it worked fine. What's it for? Should it be left in for some reason?
I also found that setting a drop down menu or checkbox field to -1 didn't give me a hidden field either so I moved the location of the code to just above:
Now the select fields, checkboxes and radio buttons will be hidden if selected.
Finally, none of the above had any effect on any field that used a user defined subroutine.
if (ref $opt->{$field} eq 'CODE') { $output .= &{$opt->{$field}}($name, $value, $rec); }
so I changed it to read
if ((ref $opt->{$field} eq 'CODE') and (${$self->{'db_form_len'}}{$field} >= 0)) { $output .= &{$opt->{$field}}($name, $value, $rec); }
Now, with all this -- setting a field to -1 will indeed make any chosen field hidden.
Peace.
Kyle
[This message has been edited by klangan (edited March 07, 2000).]
Quote:
# Display a hidden field. elsif (${$self->{'db_form_len'}}{$field} == -1) { $output .= qq~<input type=hidden name="$field" value="$value_q">$output\n~; }
The final $output is causing all the other fields to repeat over and over and over. I set 8 fields to hidden and 1 minute later, I still had no form, but had loaded over 400k of information. I removed it and it worked fine. What's it for? Should it be left in for some reason?
I also found that setting a drop down menu or checkbox field to -1 didn't give me a hidden field either so I moved the location of the code to just above:
Quote:
# Display a select list.Now the select fields, checkboxes and radio buttons will be hidden if selected.
Finally, none of the above had any effect on any field that used a user defined subroutine.
Quote:
# Run a user defined subroutine if a subroutine exists. if (ref $opt->{$field} eq 'CODE') { $output .= &{$opt->{$field}}($name, $value, $rec); }
so I changed it to read
if ((ref $opt->{$field} eq 'CODE') and (${$self->{'db_form_len'}}{$field} >= 0)) { $output .= &{$opt->{$field}}($name, $value, $rec); }
Now, with all this -- setting a field to -1 will indeed make any chosen field hidden.
Peace.
Kyle
[This message has been edited by klangan (edited March 07, 2000).]