karimali831 Posted December 30, 2010 Share Posted December 30, 2010 Hi If a string exceeds 65 characters then $show_all will return, what I want to achieve is to return the whole string when I click on the hyperlink (more...) can someone help me do this please? I do not want it to show the whole string and substr(getinput($ds['desc']),0, 65).$show_all if(strlen($ds['desc'] < 65)) $show_all = '<a href="#">(more...)"</a>'; echo substr(getinput($ds['desc']),0, 65).$show_all; thanks! Quote Link to comment Share on other sites More sharing options...
Andy-H Posted December 30, 2010 Share Posted December 30, 2010 if(strlen($ds['desc'] < 65)) $show_all = '<a href="?show=all">(more...)</a>'; if ( !isset($_GET['show']) ) { echo substr(getinput($ds['desc']),0, 65).$show_all; } else { echo getinput($ds['desc']); } Quote Link to comment Share on other sites More sharing options...
karimali831 Posted January 2, 2011 Author Share Posted January 2, 2011 thanks this will work but won't be any good for what I need it for. I am using a while loop to generate multiple rows from a table, so I need something like jquery, you click on "show all" and it will show you full text without pageload? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted January 2, 2011 Share Posted January 2, 2011 either echo all data to the page and hide it in a hidden DIV, displaying the DIV onclick. or use ajax to retrieve the additional information onclick. Quote Link to comment 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.