andrew9223 Posted August 14, 2008 Share Posted August 14, 2008 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. Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 14, 2008 Share Posted August 14, 2008 <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. Quote Link to comment Share on other sites More sharing options...
widox Posted August 14, 2008 Share Posted August 14, 2008 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 Quote Link to comment Share on other sites More sharing options...
andrew9223 Posted August 14, 2008 Author Share Posted August 14, 2008 thanks alot for the help, that worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.