CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
using textfield() from CGI module

 



recruiter
User

Feb 20, 2013, 1:09 PM

Post #1 of 2 (326 views)
using textfield() from CGI module Can't Post

Maybe my mind is going blank but im trying to figure out how to use a variable for the -value attribute in textfield. I've tried a few things but it comes back being blank or shows as a SCALAR(...).

while (my @data = $statement->fetchrow_array()) {
my $news_id = $data[0];
my $news_date = $data[1];
my $news_author = $data[2];
my $news_headline = $data[3];
my $news_text = $data[4];
}


print textfield(-name=>'news_date', -id=>'news_date', -size=>30, -value=$news_date);


lightspd
Novice

Feb 20, 2013, 2:01 PM

Post #2 of 2 (314 views)
Re: [hwnd] using textfield() from CGI module [In reply to] Can't Post

Best guess based on the example you provided.

change:
-value=
To:
-value=>

If that is just a typo, then I'll ask are you sure there is data in $news_date?

Does it work if you do something like
my $news_date = '2013-01-01';

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives