Matt Ridge Posted November 15, 2011 Share Posted November 15, 2011 Ok, I am trying to make it so that the field itself shows a N/A in it instead of being blank. So that a field does not remain blank. The original code is: echo '<div id="ncmrsr"><tr><td><span class="b">NCMR Supplier Response:<br /></span></td><textarea name="ncmrsr" rows="6" cols="85"></textarea></tr></div><br />'; I figured this would show the "N/A" in the field. echo '<div id="ncmrsr"><tr><td><span class="b">NCMR Supplier Response:<br /></span></td><textarea name="ncmrsr" rows="6" cols="85" value="N/A"></textarea></tr></div><br />'; Since this doesn't seem to work, is there a way to make it so that if a field is left empty that "N/A" is the response in said field? Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/ Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2011 Share Posted November 15, 2011 The value for a <textarea>Goes here.</textarea> Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/#findComment-1288414 Share on other sites More sharing options...
Matt Ridge Posted November 15, 2011 Author Share Posted November 15, 2011 The value for a <textarea>Goes here.</textarea> Dang, thanks. I think staring at code for 6+ hrs a day makes the simple mistakes blur together. Is there a way to make it so that if it is left blank on its own that there is automatically an N/A put in there instead of leaving a blank field? Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/#findComment-1288417 Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2011 Share Posted November 15, 2011 Probably with Javascript, but that isn't my strong suit by a long shot. Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/#findComment-1288420 Share on other sites More sharing options...
Matt Ridge Posted November 15, 2011 Author Share Posted November 15, 2011 Probably with Javascript, but that isn't my strong suit by a long shot. I was thinking that it was a $query = "INSERT INTO xxxx ('N/A') Values ('$') Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/#findComment-1288425 Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2011 Share Posted November 15, 2011 If you have a value in the form field such as <textarea>N/A</textarea>, then the field isn't empty. If you want to use a default value in the database field you can do that, but I don't see what's wrong with leaving it empty. Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/#findComment-1288427 Share on other sites More sharing options...
Matt Ridge Posted November 15, 2011 Author Share Posted November 15, 2011 If you have a value in the form field such as <textarea>N/A</textarea>, then the field isn't empty. If you want to use a default value in the database field you can do that, but I don't see what's wrong with leaving it empty. Basically I want to make it so that no field is left empty. I know weird reason but I'm not the one that is requesting this. Link to comment https://forums.phpfreaks.com/topic/251204-generic-input-na/#findComment-1288428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.