Jump to content


Photo

Form Style


  • Please log in to reply
3 replies to this topic

#1 NolanDubyu

NolanDubyu
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 February 2013 - 10:24 PM

I have never tried to style a form with hidden attributes, but for the life of me I cannot figure this out. I have tried adding a class, etc. to the hidden inputs, but still nothing. Any form of style I add
seems to just effect the outer parameters of the actual form.




<form id="search" name="search" form method="get" action="find_search.php">

<input type= "text" name= "q" value="" />
<input type="hidden" name= "cat" value="" />
<input type="hidden" name= "time" value="0" />
<input type="hidden" name="letter" value="" />
<input type="hidden" name="offset" value="0" />
<input type="hidden" name= "type" value="quick" />
<input type="submit" value="Search" />

</form>



#search {
width:50%;
padding:10px;
outline:none;
height:36px;
}

.focusField {
border:solid 2px #73A6FF;
background:#EFF5FF;
color:#000;
}

.idleField{
background:#EEE;
color:#6F6F6F;
border: solid 2px #DFDFDF;
}


Thanks in advance!

#2 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,859 posts
  • LocationCanada

Posted 18 February 2013 - 10:37 PM

Hidden fields are "hidden" - i.e. they are not shown. Therefore you can't style them. They never get focus either. What you are asking makes no sense. If you want a field that is displayed, but not editable - then you don't want to use a hidden field.
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#3 NolanDubyu

NolanDubyu
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 February 2013 - 05:32 AM

I don't want to style the hidden attributes, I believe it's the hidden attributes that are stopping my "text" input from being styled.

#4 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,859 posts
  • LocationCanada

Posted 19 February 2013 - 03:59 PM

No, that would not be the case.

In the bits of code above you have not applied any styles to the input fields. So, I must assume you are trying to apply those styles through Javascript. You do have one class, "search", which is applied to the form element - and that makes no sense. The "form" is not a visual element that is displayed. If you mean for those properties to be applied to the INPUT elements of the form - then you need to specify that.

#search input
{
    width:50%;
   padding:10px;
   outline:none;
   height:36px;
}

The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users