multi-part forms in CGI.pm

Discussion in 'Perl Misc' started by Zak, Jul 13, 2003.

  1. Zak

    Zak Guest

    Hi,
    I am a new comer to CGI.pm and find it extremely useful. I have created
    multi-form pages and with little struggle have succesfully been able to save
    states from one form to another (from one page to another). Two groups of
    people will be using the mutli-form pages to fill out the fields.
    GROUP A fills out pages 1, 2, 3.
    GROUP B fills out pages 4, 5.
    I have used save_parameters and restore_parameters to bring back the forms
    partially filled out. My dilemma now is:
    when I bring the forms back for the second group (GROUP B) to fill out their
    sections (page 4, 5), I want to "gray" sections 1, 2, 3 (pages 1, 2, 3 in
    view access only but not hide them) that Group A had already filled. Not
    give GROUP B access to enter text in fields for pages 1, 2, 3 but be able to
    display information. I don't want to use hidden() because it would hide the
    fields entriely. I want to display fields in pages 1, 2, 3 in view mode only
    for GROUP B but give them write access to pages 4,5.

    restore_parameters bring all pages and all fields in write access.

    Does anyone have an idea how manipulate this one? Any help is appreciated.
    Thanks.
    Zak, Jul 13, 2003
    #1
    1. Advertising

  2. Zak

    Sam Holden Guest

    On Sun, 13 Jul 2003 22:43:11 GMT, Zak <> wrote:
    > Hi,
    > I am a new comer to CGI.pm and find it extremely useful. I have created
    > multi-form pages and with little struggle have succesfully been able to save
    > states from one form to another (from one page to another). Two groups of
    > people will be using the mutli-form pages to fill out the fields.
    > GROUP A fills out pages 1, 2, 3.
    > GROUP B fills out pages 4, 5.
    > I have used save_parameters and restore_parameters to bring back the forms
    > partially filled out. My dilemma now is:
    > when I bring the forms back for the second group (GROUP B) to fill out their
    > sections (page 4, 5), I want to "gray" sections 1, 2, 3 (pages 1, 2, 3 in
    > view access only but not hide them) that Group A had already filled. Not
    > give GROUP B access to enter text in fields for pages 1, 2, 3 but be able to
    > display information. I don't want to use hidden() because it would hide the
    > fields entriely. I want to display fields in pages 1, 2, 3 in view mode only
    > for GROUP B but give them write access to pages 4,5.
    >
    > restore_parameters bring all pages and all fields in write access.
    >
    > Does anyone have an idea how manipulate this one? Any help is appreciated.
    > Thanks.


    By outputting the appropriate HTML for those fields.

    I doubt CGI.pm will do that for you (though I could be wrong, check the
    CGI.pm. perldoc CGI, documentation to be sure). So you will probably
    have to add the appropriate HTML to the field before outputting it,
    CGI.pm allows you to set arbitrary attributes I believe (though you're
    code would have to decide on which fields to do so).

    What those attributes are (and whether there is such a standard
    attribute or if you need to dive into browser specific extensions) is
    something you can probably find out in one of the html newsgroups, such
    as comp.infosystems.www.authoring.html.

    --
    Sam Holden
    Sam Holden, Jul 13, 2003
    #2
    1. Advertising

  3. Zak

    Rod Guest

    this is,partly anyway, an HTML question - in order to create a
    'read-only' input field pre-filled with prior data you simply add the
    'disabled attribute for that input field in the form definition.
    something like.

    <input name="textfield" type="text" value="textcheck" disabled >

    You'll have to check out the latest documentation on CGI.pm to see if
    caters for this - I also have a feeling it doesn't. also I have only
    checked the above snippet on post IE4 browsers.

    You should also check that any 'disabled fields' actually return form
    data - in the spec. I've read they don't - (ie they really are
    disabled) - this may not make a difference to you, but it's good to
    know anyway.

    Good luck
    >Hi,
    > I am a new comer to CGI.pm and find it extremely useful. I have created
    >multi-form pages and with little struggle have succesfully been able to save
    >states from one form to another (from one page to another). Two groups of
    >people will be using the mutli-form pages to fill out the fields.


    personal replies to
    Rod, Jul 14, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zak
    Replies:
    0
    Views:
    1,312
  2. Mako
    Replies:
    2
    Views:
    342
  3. Matty
    Replies:
    4
    Views:
    466
    James Steele
    Apr 6, 2005
  4. Eric
    Replies:
    2
    Views:
    467
  5. Jack
    Replies:
    8
    Views:
    265
Loading...

Share This Page