|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I don't fully understand your code logic ;) given it is a dropdown,
but for color.. just add a style attribute to the option value. <option value="1" style="color:RED;">This One</option> I am looking at the logic.. If status ISN'T blank it's INCOMPLETE? <?php if ($status) {print ("<option style=\"color:RED;\" SELECTED> INCOMPLETE FIELD</option>");} elseif (!$status) {print ("Please Select...");} ?> Let me know if I am way off base.. :)
__________________
Hardcore Programming Solutions and Coffee Drinker |
|
||||
|
ok, the php script that processes the form says basically if all fields are complete, mail to tis and do this this and this etc
Otherwise, go back to this page, and the variable $status = please supply all information. $status will only equal SOMETHING if the page has come up after not completing this field. I don't want the text in that field to be red regardless, only if we're back on that page because the field hasn't been completed so I want red text to highlight that field isn't complete. |
|
|||
|
If in your css file you have
.bold{font-weight: bold;} then you could probably use <?php if ($status != "") {print ("<span class=\"bold\">INCOMPLETE FIELD</span>");} elseif ($status=="") {print ("Please Select...");} ?> The [b] tags may not have worked because of the doctype. ?? |
|
||||
|
thanks dean will give that a go.
whilst on the subject of php I was wondering... the code that mails the form says $to = '$email'; this is so that for the time being, those testing the form can see the results and how the email will look. if anyone within our company puts their email address in the 'email' field, it mail the results to them no problem, but the minute you put an external address (eg a hotmail or yahoo address) the mail is not delivered - any ideas why this happens or how to fix it? thank you |
|
|||
|
Quote:
My two cents :) |
|
||||
|
Quote:
<option value="xyz" style="font-weight: bold;">Your Text Here</option>
__________________
PHPKB Knowledge Base Script, Custom Toolbar Development, Search Scripts Directory |
|
||||
|
Quote:
I also noticed some other code you were asking about that does some string comparison... Code:
<?php
if ($status != "") {
print ("INCOMPLETE FIELD");
} elseif ($status=="") {
print ("Please Select...");
}
?>
Code:
<?php
if (empty($status)) {
echo ('Please Select...');
} else {
echo ('INCOMPLETE FIELD');
}
?>
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |