html form question
- Started
- Last post
- 22 Responses
- fadein110
text-decoration: none!important;
- CygnusZero40
Eh screw it, Ill just do the button as an image. No big deal.
- monospaced0
So glad I'm a designer and not a web developer.
- Im a designer too, being forced to web develop. =/CygnusZero4
- CygnusZero40
Doe for the table thats connected to the CSS above. Really trying to avoid making this an image.
<table width="249" class="tableButton" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
Click here from your device<br />
to download.</td>
</tr>
</table>
- CygnusZero40
^ This is done. On the emailer now. Need to deal with my last post then I should be done with everything.
- fadein110
<script language="javascript" type="text/javascript">
function clearText(thefield){
if (thefield.defaultValue==thefield...
thefield.value = ""
}
</script><input name="name" id="name" type="text" value="your text" onFocus="clearText(this)" />
- CygnusZero40
One other question. In the emailer I have a table that I need to be a button, so I put an a tag around it and referencing the below CSS, and everything is fine except for the fact that there is a black underline in the copy in the table. Cant get rid of it. Any clues?
.tableButton
{
padding: 5px 10px !important;
font-size: 14px !important;
background-color: #7ab800;
font-weight: bold;
color: #fff;
width: 249px;
color: #ffffff;
font-family:Arial, Helvetica, sans-serif;
text-decoration:none;
}
.tableButton a:link {color:#fff; text-decoration:none;}
.tableButton a:visited {color:#fff; text-decoration:none;}
.tableButton a:hover {color:#fff; text-decoration:none;}
.tableButton a:active {color:#fff; text-decoration:none;}
- CygnusZero40
^ So what is the code for the button to reference that css? Of course when I look at their source, they do in line styles which I cant use.
- rabbit0
- google is your friend!rabbit
- i know, im just ending up on a lot of bullshit pages trying to explain everything the most complex way possible.CygnusZero4
- CygnusZero40
Its just some stupid login page, and an email newsletter template. Im just a novice developer, and dont deal with forms much.
Next question. I need to style a form/submit button. Here's my current form CSS, what tag do I add to start changing how a button looks? Gracias.
form {
background : #fff;
color : #999;
padding : 0px;
font-size : 14px;
color:#9b9ea1;
margin:0px 0px 0px 0px;
vertical-align:middle;}
input , textarea , select , option {
background : white;
color : #111;
font-family : arial, verdana, sans-serif;
font-size : 14px;
color:#9b9ea1;
border: 0px;
vertical-align:middle;
height:41px;
}- ignore all that form tag css, i know it doesnt need to be there. its in the input tag which is what i needed.CygnusZero4
- rabbit0
want me to build it for you? lol
- CygnusZero40
^ That did it, semicolon missing =/. Im obviously in a huge rush and screwing things up. This fell in my lap that some outside agency was supposed to build, and its due today of course.
- CygnusZero40
Just putting height in this isnt making the text field 43px tall.
input , textarea , select , option {
background : white;
color : #111;
font-family : arial, verdana, sans-serif;
font-size : 14px;
color:#9b9ea1;
border: 0px;
vertical-align:middle
height:43px;
}
- CygnusZero40
Line height didnt work. I think I see what the problem is. I need my text field to be 43px tall, but its not working. Not sure what the deal is.
- rabbit0
css: line-height set this to the height of the text field
- CygnusZero40
Nice, scarabin offered the easiest way. Thanks pal.
Once last question. I need my text field to be fairly tall, how do I get the text to vertically center in it? Right now its top aligned.
- akiersky0
use a bit of javascript and the onfocus hook:
http://www.w3schools.com/jsref/e…<input type="text" onfocus="myFunction()">
then set the function to make the textfield's content to nothing.
- scarabin0
you can take a look at my homepage source to see how i did it
- << this one will show you both onFocus and how to apply classes to formsflashbender
- Yep, got it. One last question below.CygnusZero4
- rabbit0
(function( $, window, document, undefined ){
//$(document).ready(function() {
//clears all form values on focus
$.fn.cleardefault = function() {
return this.live("focus", function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).live("blur", function() {
if( !this.value.length ) {
this.value = this.defaultValue;
}
});
};
$(".clearit input, .clearit textarea").cleardefault();//alert("test");
//});})( jQuery, window, document );