Knowledgebase

Building Forms in Blade Print

  • phplaravel, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Form markup.

WHAT EVERY FORM NEEDS

The correct method The request protection token Labels associated with fields Sensible field types

WHAT HAPPENS WITHOUT THE TOKEN

The submission is rejected.

That is the framework protecting you, not a fault.

WHAT TO USE FOR METHODS BEYOND THE BASIC TWO

The method field the framework provides, since browsers support only two directly.

WHAT TO REPOPULATE

Every field, with what was previously entered.

WHY

Losing entered data on a validation failure is the most damaging thing a form can do.

WHAT TO DISPLAY

Errors beside each field, and a summary where there are several.

WHAT TO SET FOR MOBILE

Appropriate input types, so the correct keyboard appears.

WHAT TO NAME FIELDS

Consistently with your validation rules and model attributes.

WHY

Mismatches produce validation that never triggers or never passes.

WHAT TO EXTRACT

Repeated field markup, into a component.

WHAT TO TEST

Submitting with everything empty, and with everything wrong.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot