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
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.