Search form and display: none

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Search form and display: none

Post by alex.barylski »

So I have a search FORM by default it's hidden (display: none) or atleast the advanced part is...

I'm curious...by default CSS is used to make the advanced part hidden...and javascript is required to make the display: none to display: block

But if the user has javascript disabled...they won't get access to the advanced section...

Is there any way I can use NOSCRIPT or something to turn the display: none to display: block but only if NOSCRIPT is executed...??? :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

You can just use CSS instead of JavaScript. I'm talking about 'hover', but that won't work on Internet Explorer.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Why not turn it around? Use css to show the form, and JS to hide it. If js is disabled for some reason, the form is shown.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I ended up doing just that :P
Post Reply