Hello Guys,I have one simple problem I am creating a PHP site with database.All works great but I want a php code which can hide a row from a click.Like I have table in Database like users then I required a simple code which can hide users details with a button click. Thanks in Advanced................
put id in the table i.e. <table id="tbl" ....>...</table> and put some button click call a jquery function i.e. <a href="javascript:void(0)" onclick="hideTable();">hide</a> and in javascript use function hideTable() { $("#tbl").hide(); } don't forget to include jQuery.
Or if you want to use Legacy Javascirpt, this is good too var myRow = document.getElementById('#tlb'); if ( myRow.style.display == 'block' || myRow.style.display == '' ){ myRow.style.display = 'none'; } else { myRow.style.display = 'block'; } Code (markup): This functions toggle the display of the row. If it's shown, it hides. Otherwise, it displays it. If you just want it to thide, remove the else {} part.
Hello Guys,I mean I want to hide Database row with a link or button ? Thanks For Your Reply.Please help me
you can not do that with php. techimtiyaz and maureeeteeeee gave the right solution. These scripts are activated on "onclick" event of the button. With php you the only thing you can do is redirect to other page on button click. The redirected page will have no users details. I don't think this is what you wanted. I guess you do not want the page to be refreshed or changed. PHP can not do that. You need Javascript or jquery for that. jquery is also a javascript. I suggest you to go with javascript solution instead of jquery because if you use jquery you will need to include the jquery file too. and including jquery for such a small task is not a good idea. What maureeeteeeee gave you is the best solution for you.