Well I must do one last post to thank everyone that helped out. I have been taken off the project now, so I won't need anyone's help with this any longer.
Again, I appreciate all your efforts and time in helping.
This is getting frustrating.
I removed the quotes and now I'm getting
Can't call method "MLSNumber" on an undefined value
I printed out the value of $sth and it all looks good.
Ok, I put in the $rownumber value for the fields. However now when I go to submit the form I get a software error saying
Can't call method "Active" on an undefined value at openhouseAdmin.cgi line 1890.
This is the code that I have for it to post to the record
if ($input{Active$rownumber}...
Right ok, I misunderstood what you were saying.
I guess I don't understand how I would generate the number in the name field .... ie: name="Active1", name="action1", name="city1", name="MLSNumber1" etc...
Here is my example of what the form looks like, so yes, your exactly right on track with that.
City Name Street Address Active
=============== ============================= ======
BigVille 1 Large St [ ]
Smalltown 3768 Little Lane...
I have it now so the form tag is outside the loop, but I can't figure out how to make each field different.
my input statement is as follows
<input type="checkbox" name="Active" value="yes" $checkedyes><input name="MLSNumber" type="Hidden" value="no">
here is my full form code
if...
Thanks ChrisHunt,
The form element makes sense moving it out of the loop. Now I gotta figure out how to make the field names different for each one.
Seems that nothing can be simple anymore.
appreciated though!!
I already do have use CGI at the start of my program and I removed &parse_form; so now it doesn't even look at that sub. But the problem still happens in that it only recognizes the last record and updates only the last one.
I am assuming your meaning the parse routine
sub ReadParse {
local (*in) = @_ if @_;
local ($i, $key, $val);
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
}
else {
$in = $ENV{'QUERY_STRING'};
if (!$in) {...
Ahh thanks,
Ok, now this is what it prints out
$VAR1 = 'city'; $VAR2 = 'All'; $VAR3 = 'Submit'; $VAR4 = 'Change'; $VAR5 = 'Active'; $VAR6 = 'No'; $VAR7 = 'MLSNumber'; $VAR8 = '99999915'; $VAR9 = 'action'; $VAR10 = 'activeconfirm2';
Which again is the last record in the form data.
If I use
use Data::Dumper;
print Dumper($input)
Then it prints out
$VAR1 = undef;
OR
if I use this
$sth = $dbh->prepare ("SELECT * FROM events where MLSNumber = '$input{MLSNumber}'");
$sth->execute ();
print $sth
$sth = "UPDATE events SET Active = '$input{Active}' WHERE MLSNumber...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.