I-AM-OBODO Posted April 7, 2012 Share Posted April 7, 2012 Hi all, pls, how can i change the error message color to red? thanks <?php echo form_open('form'); ?> <h5>First Name:</h5> <?php echo form_error('fname'); ?> <input type="text" name="fname" value="<?php echo set_value('fname'); ?>" size="50" /> <h5>Surname:</h5> <?php echo form_error('sname'); ?> <input type="text" name="sname" value="<?php echo set_value('sname'); ?>" size="50" /> <h5>Email Address</h5> <?php echo form_error('email'); ?> <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" /> <h5>Password</h5> <?php echo form_error('password'); ?> <input type="password" name="password" value="<?php echo set_value('password'); ?>" size="50" /> <h5>Password Confirm</h5> <?php echo form_error('passconf'); ?> <input type="password" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" /> <div><input type="submit" value="Submit" /></div> </form> Quote Link to comment https://forums.phpfreaks.com/topic/260504-change-error-message-color/ Share on other sites More sharing options...
scootstah Posted April 9, 2012 Share Posted April 9, 2012 I assume you are using CodeIgniter? By default form_error() places the error inside [tt<p></p>[/tt] tags. You can change these tags though, and define a CSS class. <?php echo form_error('passconf', '<p class="error"'); You can use the third parameter to close a tag other than <p>. <?php echo form_error('passconf', '<div class="error">', '</div>'); Or, you can set the error delimiters globally. $this->form_validation->set_error_delimiters('<div class="error"', '</div>'); Check the docs for more information. Quote Link to comment https://forums.phpfreaks.com/topic/260504-change-error-message-color/#findComment-1335652 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.