| | |
php pop-up link pls help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
hi.!!I have been developing an online enrolment system for a client in php...ive encountered a problem during the middle situation.The client added a situation that when the student click on the first year link, the subject of that year will just pop-up under the link.example:
first year
- Filipino
- Math
- Science
When the user click first year, the filipino,math, and science will appear, and will dissapear when they click another link.
Please help i dont know how to do this.!
first year
- Filipino
- Math
- Science
When the user click first year, the filipino,math, and science will appear, and will dissapear when they click another link.
Please help i dont know how to do this.!
Last edited by blocker; Jan 11th, 2009 at 12:11 am. Reason: wrong title
As PHP is a server side language, PHP can't be used to modify the page once it has been sent to the browser. You need a client side language (that is executed by the viewers browser) such as Javascript to do what you are explaining. I haven't done much with javasript so I can't help you any further.
★ "If your not having fun, your doing something wrong." - Humbug
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
html Syntax (Toggle Plain Text)
<html> <head> <style> .year { width:25%; margin:3%; padding:3%; float:left; } </style> <script language="javascript" type="text/javascript"> <!-- (document.getElementById) ? dom = true : dom = false; function hideIt(layer) { if (dom) {document.getElementById(layer).style.visibility='hidden';} //ie if (document.layers) {document.layers[layer].visibility='hide';} } //mozilla function showIt(layer) { if (dom) {document.getElementById(layer).style.visibility='visible';} //ie if (document.layers) {document.layers[layer].visibility='show';} } //mozilla onResize="window.location.href = window.location.href" //--></script> </head> <body> <noscript> This form requires Javascript to process</noscript> <div class='year'> <a href='#' onfocus="showIt('firstyear');" onclick="showIt('firstyear');" onblur="hideIt('firstyear');" taborder=1>First Year</a> <!-- onfocus onclick allows for keyboard tab as well as mouseclick--> <div id='firstyear' style='visibility:hidden'> <!-- initially invisible --> <input type='checkbox' value='filipino'>filipino<br> <input type='checkbox' value='math'>math<br> <input type='checkbox' value='sci'>science<br> </div></div> <div class='year'> <a href='#' onfocus="showIt('secondyear');" onclick="showIt('secondyear');" onblur="hideIt('secondyear');" taborder=2>second Year</a> <div id='secondyear' style='visibility:hidden'> <input type='checkbox' value='filipino'>2filipino<br> <input type='checkbox' value='math'>2math<br> <input type='checkbox' value='sci'>2science<br> </div></div> <div class='year'> <a href='#' onfocus="showIt('thirdyear');" onclick="showIt('thirdyear');" onblur="hideIt('thirdyear');" taborder=3>third Year</a> <div id='thirdyear' style='visibility:hidden'> <input type='checkbox' value='filipino'>3filipino<br> <input type='checkbox' value='math'>3math<br> <input type='checkbox' value='sci'>3science<br> </div></div> </body</html>
Its been a long time since I coded anything new in javascript, if the script does not run, change the
id='firstyear' to name='firstyear' edit** for tabulated data as first year .. second year .. third year
Last edited by almostbob; Jan 11th, 2009 at 5:38 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Please mark solved problems, solved
If at first you dont succeed, join the club
Please mark solved problems, solved
i messed up
as above attempting to select a checkbox will hide them again, should be::
as above attempting to select a checkbox will hide them again, should be::
<a href='#' onfocus="showIt('firstyear');hideIt('secondyear');hideIt('thirdyear');" onclick="showIt('firstyear');hideIt('secondyear');hideIt('thirdyear');" tabindex=1>First Year</a> Last edited by almostbob; Jan 11th, 2009 at 6:04 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Please mark solved problems, solved
If at first you dont succeed, join the club
Please mark solved problems, solved
•
•
•
•
As PHP is a server side language, PHP can't be used to modify the page once it has been sent to the browser. You need a client side language (that is executed by the viewers browser) such as Javascript to do what you are explaining. I haven't done much with javasript so I can't help you any further.
Thank you for your advise>!!i will try to search and code this maybe tommorow in javascript.!
•
•
•
•
the javacript will hide or show any number of div span p textareahtml Syntax (Toggle Plain Text)
<html> <head> <style> .year { width:25%; margin:3%; padding:3%; float:left; } </style> <script language="javascript" type="text/javascript"> <!-- (document.getElementById) ? dom = true : dom = false; function hideIt(layer) { if (dom) {document.getElementById(layer).style.visibility='hidden';} //ie if (document.layers) {document.layers[layer].visibility='hide';} } //mozilla function showIt(layer) { if (dom) {document.getElementById(layer).style.visibility='visible';} //ie if (document.layers) {document.layers[layer].visibility='show';} } //mozilla onResize="window.location.href = window.location.href" //--></script> </head> <body> <noscript> This form requires Javascript to process</noscript> <div class='year'> <a href='#' onfocus="showIt('firstyear');" onclick="showIt('firstyear');" onblur="hideIt('firstyear');" taborder=1>First Year</a> <!-- onfocus onclick allows for keyboard tab as well as mouseclick--> <div id='firstyear' style='visibility:hidden'> <!-- initially invisible --> <input type='checkbox' value='filipino'>filipino<br> <input type='checkbox' value='math'>math<br> <input type='checkbox' value='sci'>science<br> </div></div> <div class='year'> <a href='#' onfocus="showIt('secondyear');" onclick="showIt('secondyear');" onblur="hideIt('secondyear');" taborder=2>second Year</a> <div id='secondyear' style='visibility:hidden'> <input type='checkbox' value='filipino'>2filipino<br> <input type='checkbox' value='math'>2math<br> <input type='checkbox' value='sci'>2science<br> </div></div> <div class='year'> <a href='#' onfocus="showIt('thirdyear');" onclick="showIt('thirdyear');" onblur="hideIt('thirdyear');" taborder=3>third Year</a> <div id='thirdyear' style='visibility:hidden'> <input type='checkbox' value='filipino'>3filipino<br> <input type='checkbox' value='math'>3math<br> <input type='checkbox' value='sci'>3science<br> </div></div> </body</html>
Its been a long time since I coded anything new in javascript, if the script does not run, change theid='firstyear'toname='firstyear'edit** for tabulated data as
first year .. second year .. third year
God bless.!
![]() |
Similar Threads
- SMS Message With PHP/MYSQL (PHP)
- sending sms using vb.net (VB.NET)
- Sms facility (PHP)
- Sending SMS from PC (Computer Science)
- Freelance Programming Services PHP, JAVA,VB.NET, C#, C++ and etc (Web Development Job Offers)
- Can a PHP website be edited by myself? (PHP)
- Freelance Programming Services Java, PHP, VB.NET, C# and etc (Web Development Job Offers)
- sms via java (Java)
Other Threads in the PHP Forum
- Previous Thread: the value of foreach loop keeps increasing
- Next Thread: How to add amount of items in shopping cart? Need urgent help!
| Thread Tools | Search this Thread |
apache api array basic beginner body broken cache cakephp class cms code computing confirm cron curl customizableitems database date date/time delete dynamic email error file filter folder form forms forum freelancing function functions gc_maxlifetime google header headmethod howtowriteathesis href htaccess html iframe image include ip javascript joomla limit link list login malfunction memmory memory menu mod_rewrite msqli_multi_query multiple mycodeisbad mysql navigation neutrality oop parameter parsing paypal pdf php phpmysql query question random recourse regex root script search select seo server sessions snippet source space sql static system table thesishelp trouble tutorial update upload url variable video web webdesign xml youtube






