CGI PROBLEM

  • Thread starter miem kuen choi cheung
  • Start date
M

miem kuen choi cheung

how to write a perl cgi for keep track the value of a form in html page, so
that none of the field in the form will be blank?
 
G

Gunnar Hjalmarsson

miem said:
how to write a perl cgi for keep track the value of a form in html
page, so that none of the field in the form will be blank?

Have the script test just that after parsing the form data.
 
W

wana

miem kuen choi cheung said:
how to write a perl cgi for keep track the value of a form in html page, so
that none of the field in the form will be blank?

Are you using CGI.pm? I definitely recommend Dr. Lincoln Stein's book
on it. I had to order it on Amazon because the local book stores
don't carry it.

then, for example, a text field is written like this:

print textfield(-name=>'myfield', -value=>'my default text');

The text field will now show 'my default text' when you first load the
form. If the form is reloaded, the default behavior is for the
textfield to retain it's previous value ('stickiness') which is a
feature but it can cause headaches if you forget it. Make it forget
it's previous value like this:

print textfield(-name=>'myfield', -override=>1, -value=>'my default
text');

or

print textfield(-name=>'myfield', -force=>1, -value=>'my default
text');

I like to place override after name for some reason, but being an
anonymous hash, the order is not important.

Sorry if I told you something you already knew. I am the biggest Perl
newbie ever so it's hard to believe I could teach anyone anything new
at this point, but I'm working on it.
 

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

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,891
Members
47,423
Latest member
henerygril

Latest Threads

Top