Page 1 of 1

How to use CSS code to style vote button in php file?

Posted: Fri Jun 04, 2004 3:51 pm
by chesterskeeper
Hello.

I am trying to use the regular submit button for my poll using a php script. I want the submit button to match just like the other one I currently have on the page....gray background, highlights with yellow borders when hovering.

In HTML, the code is:

<input type="button" value="Submit">

How can I use the same look of that submit button in this code:

// Use CSS code to style the 'vote' button
$buttonstyle="border:1px solid gray;
background:#CCCCCC;color:black;";

When I tried:
$buttonstyle="input type"button" value "submit"";

I saw a small button (just the one I wanted) but all text was missing so of course it didnt work. I tried adding brackets and commas, couldn't get anything to work.

Can someone please help me here??

Thanks!

Posted: Fri Jun 04, 2004 4:56 pm
by feyd

Code: Select all

<input type="button" value="Submit" style="<?php echo $buttonstyle; ?>">
that'll do it, if the page is a php processed page, and is outside the <?php tags...

inside php tags:

Code: Select all

echo '<input type="button" value="Submit" style="'.$buttonstyle.'">';
// or
echo "<input type="button" value="Submit" style="$buttonstyle">";
// there are many more ways.. but you get the picture, I hope.