Turning *OFF* form-vble copying in CGI.pm

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default Turning *OFF* form-vble copying in CGI.pm

    Is there some way to turn *OFF* the machinery in CGI.pm that
    automatically forces form variables to take their values from the
    incoming CGI request rather than what you *tell* it in your program?
    I know about "override => 1", but I find it both annoying and a waste
    of space to do that scores of times [since as far as I know (over many
    years of using CGI.pm in quite a lot of CGI programs], I have *NEVER*
    wanted it to blindly/auotmatically copy the values from old-form =>
    new form, so I need to put the 'override' onto _every_ form tag;
    UGH!].

    Can I somehow specify a global-default-value for override? I looked
    in the very latest docs on Lincoln's website and for even the very
    latest version [which we're NOT running], it still says:
    >>>The default values that you specify for the forms are only used the
    >>>first time the script is invoked. If there are already values present
    >>>in the query string, they are used, even if blank.
    So I think I'm out of luck [and I obviously must be thinking about
    CGI-matters in the wrong way, because the auto-value-copying has
    *always* struck me as the wrong thing to do, but obviously a fair
    number of folk like it and/or use it, else I suspect there'd long
    since have been a flag to set the default to override=>0.] Oh well...

    /Bernie\

    Bernard Cosell Guest

  2. Similar Questions and Discussions

    1. Form fields rotate after copying/pasting
      Why would this be a feature request? The ability to replace pages in forms is an established feature. The fact that this doesn't work in landscape...
    2. Turning off audio?
      Is there any way to turn off the audio on a game? I was playing around with the game at http://www.bubblebox.com/game/adventure/91.htm , and I'd...
    3. Turning a file into an ad
      Hi there I really need some beginner help. I need to turn this file http://www.thefightmusic.com/f/header3.swf Into a 468*60 banner ad. Basically...
    4. THOSE OTF FONTS: TURNING 'EM OFF
      OS 10.2.8 / dual 1-gHz / Illustrator CS: I normally use Suitcase (X1) to manage my fonts. I remove all extraneous fonts and keep them in a central...
    5. turning off 3D animation?
      Hello Martin, 1. There is a way by code to stop all animations before your movie starts. In a movie script, place the following code: on...
  3. #2

    Default Re: Turning *OFF* form-vble copying in CGI.pm

    On Fri, 9 Jan 2004, Bernard Cosell wrote:
    > Is there some way to turn *OFF* the machinery in CGI.pm that
    > automatically forces form variables to take their values from the
    > incoming CGI request rather than what you *tell* it in your program?
    Are you looking for [url]http://stein.cshl.org/WWW/software/CGI/[/url] and
    its documentation of the -nosticky pragma?

    Alan J. Flavell Guest

  4. #3

    Default Re: Turning *OFF* form-vble copying in CGI.pm

    Bernard Cosell <bernie@rev.net> said:
    >Is there some way to turn *OFF* the machinery in CGI.pm that
    >automatically forces form variables to take their values from the
    >incoming CGI request rather than what you *tell* it in your program?
    Doesn't this do the trick (from CGI documentation, didn't test but seems
    to be what you want):

    To create an empty query, initialize it from an empty
    string or hash:

    $empty_query = new CGI("");

    -or-

    $empty_query = new CGI({});
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho Guest

  5. #4

    Default Re: Turning *OFF* form-vble copying in CGI.pm

    On Fri, 09 Jan 2004 12:43:37 -0500, Bernard Cosell <bernie@rev.net>
    wrote:
    >Is there some way to turn *OFF* the machinery in CGI.pm that
    >automatically forces form variables to take their values from the
    >incoming CGI request rather than what you *tell* it in your program?
    I've found a fairly comfortable way to deal with this, so I'm probably
    a reasonably-happy-camper at the moment: I've just stuck in a
    "$cgi->delete_all()" right before I start generating the outgoing
    form. I've already copied all the form vbls I care about to 'my'
    vbls, so making all that detritus that I didn't care about anyway just
    go away entirely works for me....

    /Bernie\

    Bernard Cosell Guest

  6. #5

    Default Re: Turning *OFF* form-vble copying in CGI.pm

    "Alan J. Flavell" <flavell@ph.gla.ac.uk> wrote:

    } On Fri, 9 Jan 2004, Bernard Cosell wrote:
    }
    } > Is there some way to turn *OFF* the machinery in CGI.pm that
    } > automatically forces form variables to take their values from the
    } > incoming CGI request rather than what you *tell* it in your program?
    }
    } Are you looking for [url]http://stein.cshl.org/WWW/software/CGI/[/url] and
    } its documentation of the -nosticky pragma?

    Indeed I was -- I'd been through the docs looking for such a thing, but I
    didn't see that [the usual problem with docs: if you don't know where to
    look, it is hard/impossible to find what you're looking for].

    Note that from the *very* doc URL you referenced above, it says:
    >>> If you want to change the value of a field from its previous value, you have two choices:
    >>>
    >>> call the param() method to set it.
    >>> use the -override (alias -force) parameter. (This is a new feature in 2.15) This forces
    >>> the default value to be used, regardless of the previous value of the field:
    >>> print $query->textfield(-name=>'favorite_color',
    >>> -default=>'red',
    >>> -override=>1);
    >>>
    >>> If you want to reset all fields to their defaults, you can:
    >>> Create a special defaults button using the defaults() method.
    >>> Create a hypertext link that calls your script without any parameters.
    Notice, no mention of '-nosticky', and hence my inquiry... but now I know!
    THANKS!!

    /Bernie\

    --
    Bernie Cosell Fantasy Farm Fibers
    [email]bernie@fantasyfarm.com[/email] Pearisburg, VA
    --> Too many people, too few sheep <--
    Bernie Cosell Guest

  7. #6

    Default Re: Turning *OFF* form-vble copying in CGI.pm

    On Sat, 10 Jan 2004, Bernie Cosell wrote:
    > Note that from the *very* doc URL you referenced above, it says:
    [...]
    > >>> If you want to reset all fields to their defaults, you can:
    > >>> Create a special defaults button using the defaults() method.
    > >>> Create a hypertext link that calls your script without any parameters.
    >
    > Notice, no mention of '-nosticky', and hence my inquiry... but now I know!
    Feel free to email the author! He's not unaccustomed to getting
    occasional stroppy comments from me ;-)

    all the best
    Alan J. Flavell Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139