Menu

#5 required vs optional

open
None
6
2006-05-27
2005-09-07
JT Moree
No

you may want to add a Form category and maybe Normal,
Frameset too?

there are screens where It would be preferrable to use
an optional marker instead of a required marker. ex.
if all fields are required except for 1 then it would
be nicer to simply have an optional market output next
to the optional field and forgo the required markers.

for now I'll manually hack it in but perhaps you could
add this to the form stuff.

alternatively, we make the required fields be bold or
some other color than the optional fields and not
output the +, etc. That is what I'm seeing a lot of
forms do recently.

Doing the optional marker is going to be a lot more
work than changing the formatting of the required
fields and not outputting the required field tag.

Changing from a marker to a style would probably be an
acceptable solution as long as there are two styles.
so for now we will create two classes required and
optional. Then I can markup either as I desire.

simply add the class="optional|required" to the labels?
<span class="required">Label1</span>

and then the formrequired string would output
<span class="required">+ Required</span>
<span class="optional">Optional</span>

This would work, if it was around the labels for the
fields and not outputting a +, etc. to indicate the
field was required.

Optionally, I could keep the required string and just
wrap the labels as you indicated above. Now, if you
want a flag that indicates not to output the required
string and output an optional flag, then that means
that you have to have the required field set for the
field, like #R=x#, otherwise I still won't have
anything to replace to give a visual queue (+), etc.
other than just the label css.

I'll define some default attributes for the required
and optional css entries and allow the programmer to
override them in the generate call or via css itself,
however they want to do it.

Discussion

  • JT Moree

    JT Moree - 2005-09-07

    Logged In: YES
    user_id=236631

    Ideally, the form generation would be smart enough to only
    output the Legends if there are optional or required fields
    defined. #FORMREQUIREDSTRING# would be fine for both
    Legends. If the profile has either/or defined that spot
    would get the defined ones.

     
  • JT Moree

    JT Moree - 2005-09-07
    • priority: 5 --> 4
     
  • JT Moree

    JT Moree - 2006-03-18

    Logged In: YES
    user_id=236631

    The search forms in xiwa are using NO required fields yet
    the FORMREQUIRED string is being output. Since everything
    on the form is hidden and only the page index links are
    showing it looks stupid. I'm not specifying a template so
    it's generating one. I guess it's putting the 'Form items
    marked with + are required.' as part of the template.

    The template generator needs to be smarter and NOT do that
    if there are NO required items. If you are putting internal
    vars in and requiring them then it's your own fault and you
    need to work around them. I'd prefer this were done before
    xiwa is released because we may not release another stable
    portal for a while.

     
  • JT Moree

    JT Moree - 2006-03-18
    • priority: 4 --> 7
    • assigned_to: nobody --> pcxuser
     
  • JT Moree

    JT Moree - 2006-03-24

    Logged In: YES
    user_id=236631

    I attached a patch to stop the required string from
    outputting when there are NO required vars. Please apply NOW!

     
  • JT Moree

    JT Moree - 2006-03-24
     
  • JT Moree

    JT Moree - 2006-05-05

    Logged In: YES
    user_id=236631

    changed to bug because it is outputting the form required
    string when the form is ALL hidden fields. PLEASE apply patch!

     
  • JT Moree

    JT Moree - 2006-05-05
    • priority: 7 --> 9
     
  • James A. Pattie

    James A. Pattie - 2006-05-19

    Logged In: YES
    user_id=27290

    I've implemented the first version of what I think will fix
    this, but I'm not sure if treating submit and buttons as
    non-user input form items is the correct thing.

    It all comes down to how you are submitting the hidden form.

    There should be updated debs in unstable.

     
  • James A. Pattie

    James A. Pattie - 2006-05-27
    • priority: 9 --> 6
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.