• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confusion in question 22 in chapter 10 of Head First

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I really don't understand question 22 of Head First book of chapter 10. The question is:

A web application includes many forms for users to fill out and submit. Nothing in the pages indicates that a field is required. Business decided that a red asterisk shoubl be place preceding the text labels of required fields but the project manager is contending that the background color of required fields be light blue and another department is demanding that the project's application be consistent with their own, where the text of the labels be bold for required fields.

A. <cust:requiredIcon/> First Name: <input type="text" name="firstName" />

B. <cust:textField label="First Name " required="true"/>

C. <cust:requiredField color="red" symbol="*" label="First Name" />

D. <cust:required> First Name: <input type="text" name="firstName "/>
</cust:required>


I really don't get it, why the option B is correct, not A, C, and D?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A. This is likely to show an image next to the required field, but this does not customize the way the label looks. It doesn't meet the requirements.
C. The color and the symbol used for the required field are hard coded. Looking at the requirements, it's likely to change, and should be easily customized. You don't want to change all your JSPs when department A comes and say : finally we want a pink moose next to the required fields. The way required fields are shown could also be dynamically changed depending on the logged user's department.
D. It's not going to be easy to customize how the label looks, or how the input field looks, because you'll need to parse the body content, which should be avoided.

B. Let's you decide how to show the label, let's you decide if you put an image, an asterisk or something else, let's you decide how to show the input field.
 
reply
    Bookmark Topic Watch Topic
  • New Topic