HTML5 Input Required Attribute

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

ravoras
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Mar 22, 2012 8:11 am

HTML5 Input Required Attribute

Postby ravoras » Thu Apr 19, 2012 11:06 am

Hey Guys,

I came across the 'required' attribute for input tags in HTML5, and it just super handy.

But I was wondering, if there is workaround for dependent inputs using just the required attribute.

Like:

Say I have a select box, which has certain entries. Depending on the user selection, the user may have to fill out extra information (which is required).

I know how to do this with JS etc. But since I came across the required attribute I am curious, if this is achievable. That would be super!

Thanks.

Best Regards

User avatar
minimihi
New php-forum User
New php-forum User
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Re: HTML5 Input Required Attribute

Postby minimihi » Thu Apr 19, 2012 3:12 pm

With required attribute you still would need to use JS.
Since you would be depending on select box value to chose where to add/remove required attribute to/from other input elements.

That's my conclusion after reading HTML5 <input> required Attribute and HTML5 <input> Tag


Return to “HTML Basics”

Who is online

Users browsing this forum: No registered users and 0 guests

cron