Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(jeffa) Re: Increment Number with form button push

by jeffa (Bishop)
on Jun 13, 2002 at 19:48 UTC ( #174315=note: print w/replies, xml ) Need Help??


in reply to Increment Number with form button push

You are never updating the variable to be carried over. First, $add_limit is unecessary, just do this instead:
my $limit_3 = param("limit_3"); my $limit = param("limit"); $limit = ($limit_3 + $limit); print $limit; # and rest of form
Now, when you write out the hidden field, it will contain the current value. Before, you were writing out $limit to the hidden field without changing it's initial value, which was always 0.

Here is some more code to meditate upon:

use strict; use CGI qw(:standard); my $i = param('hidden_i') || 0; my @view = qw( first second third fourth fifth sixth seventh eighth ); my $view = $view[$i++]; param('hidden_i',$i % @view); print header, start_html('hidden fields'), h1($view), start_form, hidden('hidden_i'), submit, end_form, end_html, ;

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Increment Number with form button push
by peppiv (Curate) on Jun 13, 2002 at 20:11 UTC
    Ah Yes! This works!
    If I wasn't having such a brain fart I'd write something clever.

    Thanx

    peppiv

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://174315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2021-08-03 05:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (32 votes). Check out past polls.

    Notices?