jamichelli Posted April 23, 2009 Share Posted April 23, 2009 I'm trying to insert the default message "Not Required" into the text field of a form, in a table. Once all fields validate, the next page contains a table with all the input for the user to verify before submitting to the database. My goal is to have the table on the verification page not contain empty cells, but to have the field that was not completed to submit "Not Required" to this cell and give the page a finished "pretty" look. I have done the same thing successfully with a textarea, but the text field is not displaying my default message within the field, but rather to the right of the field. I cannot seem to get the default message into this text field, which leaves the cell in the verification table very "ugly". Any help on how to do this successfully with the text field? What is not working: <td colspan="2" class="labelcell"><label for="subject_address2">Address (Line 2)</label></td> <td colspan="2" class="fieldcell"><input type="text" name="subject_address2" size="40" tabindex="4" value="<?php echo stripslashes($usrAddress2); ?>" />(Not Required)</td> What is working: <td colspan="2" class="smalllabelcell"><label for="repairs_needed">Repairs Needed?</label></td> <td colspan="2" class="smallfieldcell"><textarea rows="10" cols="40" type="text" tabindex="13" name="repairs_needed" value="<?php echo stripslashes($usrRepairsNeeded); ?>">(Not Required)</textarea></td> Quote Link to comment https://forums.phpfreaks.com/topic/155310-solved-quick-form-question/ Share on other sites More sharing options...
JonnoTheDev Posted April 23, 2009 Share Posted April 23, 2009 <input type="text" name="email" value="<?php print (strlen($_POST['email']) ? $_POST['email'] : "Not Required"); ?>" /> Quote Link to comment https://forums.phpfreaks.com/topic/155310-solved-quick-form-question/#findComment-817219 Share on other sites More sharing options...
jamichelli Posted April 23, 2009 Author Share Posted April 23, 2009 Thank you very much Neil!!! Quote Link to comment https://forums.phpfreaks.com/topic/155310-solved-quick-form-question/#findComment-817885 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.