Jump to content

php and style sheet question


andrew9223

Recommended Posts

I pretty new to php, I started using it yesterday::) It has taken me like 20 hours to make one form with alot of help from friends. I've finally got it work and want to clean it up a bit.

 

Here is what I'm trying to do. If you hit submit without filling in one of the textboxs on the form a * will pop up next to that textbox.

 

<td align="right" valign="top" class="style5">City</td>
                <td><input name="City" type="text" size="70" value="<?= $_POST['City'] ?>" class="textboxstyle" />
	<? if($missing && $_POST['City'] == '') print "*" ?></td>
              </tr>

 

 

I'm trying to have the * pull its style from a style sheet, right now it is just a plain old black * and I want to make it fit in with the other text on my site. I can't seem to figure it out and I'm not really sure what to search for.

If anyone can help with this I'd very much appreciate it.

Link to comment
https://forums.phpfreaks.com/topic/119726-php-and-style-sheet-question/
Share on other sites

<td align="right" valign="top" class="style5">City</td>
                <td><input name="City" type="text" size="70" value="<?= $_POST['City'] ?>" class="textboxstyle" />
	<?php if($missing && $_POST['City'] == '') print '<div class="className">*</div>' ?></td>
              </tr>

 

Replace className with the class you want applied to your asterisk.

You also need to learn how to use the text editor.. I think you've got a bit to many [ code ] bits in there.

 

Anyway, just wrap the * in an element.

<? if($missing && $_POST['City'] == '') print "<em>*</em>" ?></td>
              </tr>

 

Then use CSS to target that element (em). Such as

.style5 em { color: red; }

 

HTH

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.