By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Form values in HTML not retaining.

P: n/a
Hi All,

I am calling a cgi file from a perl module. The cgi file contains the
HTML form and some HTML fields(like check boxes).
In my logic, I am trying to submit the form and calling the same cgi
file again.

While doing this, i am not able to retain the values of the HTML
fields (check boxes values ) which i set earlier before submitting
the form.

But my application requires me to use the same values of check
boxes( prior to submission) for further processing after submission of
the form.

But here all those prior values of check boxes are changing to NULL
after submission of the form, thereby NOT allowing me to proceed
further.

Please help me out in this regard.

I am not sure if this is exactly a PHP related question but i could
not find any sources in and around me to solve this problem so i had
to post it here.
If this post is not relevant to this group, please guide me to
appropriate group where i can find a solution to this problem.

Thanks and Regards,
Anusha Vempati.
Sep 5 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Message-ID:
<ed**********************************@e39g2000hsf. googlegroups.comfrom
an*************@gmail.com contained the following:
>I am calling a cgi file from a perl module. The cgi file contains the
HTML form and some HTML fields(like check boxes).
In my logic, I am trying to submit the form and calling the same cgi
file again.

While doing this, i am not able to retain the values of the HTML
fields (check boxes values ) which i set earlier before submitting
the form.

But my application requires me to use the same values of check
boxes( prior to submission) for further processing after submission of
the form.
Yes, HTML is a stateless protocol. If you want the values to be
maintained you need to pass them back into the HTML. In php this could
be achieved by something like this:-

<input type = 'checkbox' name='box1' value='yes' <?php echo
(isset($_POST['box1'])&&$_POST['box1']=="Yes")?"checked": ""; ?>>

Check out comp.lang.perl.misc for advice on how to do it in perl.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
Sep 5 '08 #2

P: n/a
In our last episode,
<ed**********************************@e39g2000hsf. googlegroups.com>,
the lovely and talented an*************@gmail.com
broadcast on comp.lang.php:
Hi All,
I am calling a cgi file from a perl module. The cgi file contains the
HTML form and some HTML fields(like check boxes).
In my logic, I am trying to submit the form and calling the same cgi
file again.
This is not a php question. It is a perl or cgi question. There are groups
for both.
While doing this, i am not able to retain the values of the HTML
fields (check boxes values ) which i set earlier before submitting
the form.
It is not clear what your problem is.

You do know that your perl cgi will not 'remember' values from a previous
invocation, don't you? If you will need values again, pass them to the
next invocation as hidden inputs.

If you are trying to parse the query string yourself, it is possible you are
going wrong somewhere. There is a perl module to simplify this.

--
Lars Eighner <http://larseighner.com/us****@larseighner.com
Fast, Cheap, Good: Choose any two.
Sep 5 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.