suma237 Posted July 17, 2007 Share Posted July 17, 2007 i want to display current date if the value is empty. <input type="text" name="I_CreatedOn" class='textbox' readonly value='if(empty($row[i_CreatedOn]))? echo $date_now;:echo $row[i_CreatedOn];'> Thanks Link to comment https://forums.phpfreaks.com/topic/60319-solved-error-inside-the-textbox-value/ Share on other sites More sharing options...
jitesh Posted July 17, 2007 Share Posted July 17, 2007 <input type="text" name="I_CreatedOn" class='textbox' readonly value="<?php echo (empty($row[i_CreatedOn]))?$date_now:$row[i_CreatedOn];?>"> Link to comment https://forums.phpfreaks.com/topic/60319-solved-error-inside-the-textbox-value/#findComment-300086 Share on other sites More sharing options...
tapos Posted July 17, 2007 Share Posted July 17, 2007 You will have use <?php?> tag. also u can not use ?: for if statement value='if(empty($row[i_CreatedOn]))? echo $date_now;:echo $row[i_CreatedOn];' this shall/will be value='<?=empty($row[i_CreatedOn])?$date_now:$row[i_CreatedOn]?>' -- Tapos Pal Link to comment https://forums.phpfreaks.com/topic/60319-solved-error-inside-the-textbox-value/#findComment-300088 Share on other sites More sharing options...
suma237 Posted July 17, 2007 Author Share Posted July 17, 2007 thanks everybody..i solved this Link to comment https://forums.phpfreaks.com/topic/60319-solved-error-inside-the-textbox-value/#findComment-300091 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.