Jay2391 Posted September 26, 2007 Share Posted September 26, 2007 So I have this form that i wanted to align and look good right to imput registration information.... so what I did.... I put the form in a table and i wanted to be sticky because i have to verify for errors before sending to the table.. the issue i have is that the error mesage will only come up under the submit button.... I want errors to show at the top or in the side of each text field... check the code . <?php ini_set ('display_error',1); error_reporting (E_ALL & ~E_NOTICE); define ('Title', 'Register'); print '<style type="text/css"> <!-- .style10 {font-size: 20px; font-family: Verdana;} --> </style>'; print '<p><div align="left" class="style10"><font color="blue">Registration Form</font></div></p>'; print '<form action="md_reg.php" method="post">'; echo " $error_name "; print '<style type="text/css"> <!-- .style9 {font-size: 9px; font-family: Verdana;} --> </style> <style type="text/css"> <!-- .style7 {font-size: 10px; font-family: Verdana;} --> </style> <table width="400" border="0" cellspacing="0" cellpadding="0"><tr> <th width="80" height="12" align="center" valign="middle" nowrap="nowrap" scope="col"> <div align="left" class="style9">ID:</div></th> <td width="200" height="12" align="center" valign="middle" nowrap="nowrap" scope="col"> <div align="left" class="style9"><input type="text" name="id" size"100" value="' . $_POST['id'] . '"/></div></td> <td width="200" height="12" align="center" valign="middle" nowrap="nowrap" scope="col"> [color=red][font=Verdana]//////error should be here!!!![/font][/color] </td> </tr> print '<br><input type="submit" name="submit" size"20" value="Register!!"/><br /></h4>'; if ( isset ($_POST['submit'])){ $problem = FALSE; if (empty ($_POST['id'])){ $problem = TRUE; $error_id = '<div align="left" class="style9"><font color="red">Please create a "User Name"</div>'; echo "$error_id"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/70786-help-with-error-display/ Share on other sites More sharing options...
cooldude832 Posted September 26, 2007 Share Posted September 26, 2007 then put it above the form in your code block. How did that not make sense? also you have E_report all on this page. That is a super global function for compiling errors, not logical errors in a form's submission Quote Link to comment https://forums.phpfreaks.com/topic/70786-help-with-error-display/#findComment-355903 Share on other sites More sharing options...
Jay2391 Posted September 26, 2007 Author Share Posted September 26, 2007 what about the first option on the side of the text box??? Quote Link to comment https://forums.phpfreaks.com/topic/70786-help-with-error-display/#findComment-355923 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.