php pop-up link pls help

Reply

Join Date: Jan 2009
Posts: 125
Reputation: blocker is an unknown quantity at this point 
Solved Threads: 0
blocker's Avatar
blocker blocker is offline Offline
Junior Poster

php pop-up link pls help

 
0
  #1
Jan 11th, 2009
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.!
Last edited by blocker; Jan 11th, 2009 at 12:11 am. Reason: wrong title
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 93
Reputation: humbug is an unknown quantity at this point 
Solved Threads: 13
humbug's Avatar
humbug humbug is offline Offline
Junior Poster in Training

Re: php pop-up link pls help

 
0
  #2
Jan 11th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,351
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: php pop-up link pls help

 
0
  #3
Jan 11th, 2009
  1. <html>
  2. <head>
  3. <style>
  4. .year { width:25%; margin:3%; padding:3%; float:left; }
  5. </style>
  6. <script language="javascript" type="text/javascript">
  7. <!--
  8. (document.getElementById) ? dom = true : dom = false;
  9. function hideIt(layer) {
  10.  if (dom) {document.getElementById(layer).style.visibility='hidden';} //ie
  11.  if (document.layers) {document.layers[layer].visibility='hide';} } //mozilla
  12. function showIt(layer) {
  13.  if (dom) {document.getElementById(layer).style.visibility='visible';} //ie
  14.  if (document.layers) {document.layers[layer].visibility='show';} } //mozilla
  15. onResize="window.location.href = window.location.href"
  16. //--></script>
  17. </head>
  18. <body>
  19. <noscript> This form requires Javascript to process</noscript>
  20. <div class='year'>
  21. <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-->
  22. <div id='firstyear' style='visibility:hidden'> <!-- initially invisible -->
  23. <input type='checkbox' value='filipino'>filipino<br>
  24. <input type='checkbox' value='math'>math<br>
  25. <input type='checkbox' value='sci'>science<br>
  26. </div></div>
  27. <div class='year'>
  28. <a href='#' onfocus="showIt('secondyear');" onclick="showIt('secondyear');" onblur="hideIt('secondyear');" taborder=2>second Year</a>
  29. <div id='secondyear' style='visibility:hidden'>
  30. <input type='checkbox' value='filipino'>2filipino<br>
  31. <input type='checkbox' value='math'>2math<br>
  32. <input type='checkbox' value='sci'>2science<br>
  33. </div></div>
  34. <div class='year'>
  35. <a href='#' onfocus="showIt('thirdyear');" onclick="showIt('thirdyear');" onblur="hideIt('thirdyear');" taborder=3>third Year</a>
  36. <div id='thirdyear' style='visibility:hidden'>
  37. <input type='checkbox' value='filipino'>3filipino<br>
  38. <input type='checkbox' value='math'>3math<br>
  39. <input type='checkbox' value='sci'>3science<br>
  40. </div></div>
  41. </body</html>
the javacript will hide or show any number of div span p textarea
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, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,351
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: php pop-up link pls help

 
0
  #4
Jan 11th, 2009
i messed up
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, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 125
Reputation: blocker is an unknown quantity at this point 
Solved Threads: 0
blocker's Avatar
blocker blocker is offline Offline
Junior Poster

Re: php pop-up link pls help

 
0
  #5
Jan 15th, 2009
thank you very much its working now..hope to see you again.!1

God bless.!
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 125
Reputation: blocker is an unknown quantity at this point 
Solved Threads: 0
blocker's Avatar
blocker blocker is offline Offline
Junior Poster

Re: php pop-up link pls help

 
0
  #6
Jan 15th, 2009
Originally Posted by humbug View Post
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.!
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 125
Reputation: blocker is an unknown quantity at this point 
Solved Threads: 0
blocker's Avatar
blocker blocker is offline Offline
Junior Poster

Re: php pop-up link pls help

 
0
  #7
Jan 15th, 2009
Originally Posted by almostbob View Post
  1. <html>
  2. <head>
  3. <style>
  4. .year { width:25%; margin:3%; padding:3%; float:left; }
  5. </style>
  6. <script language="javascript" type="text/javascript">
  7. <!--
  8. (document.getElementById) ? dom = true : dom = false;
  9. function hideIt(layer) {
  10.  if (dom) {document.getElementById(layer).style.visibility='hidden';} //ie
  11.  if (document.layers) {document.layers[layer].visibility='hide';} } //mozilla
  12. function showIt(layer) {
  13.  if (dom) {document.getElementById(layer).style.visibility='visible';} //ie
  14.  if (document.layers) {document.layers[layer].visibility='show';} } //mozilla
  15. onResize="window.location.href = window.location.href"
  16. //--></script>
  17. </head>
  18. <body>
  19. <noscript> This form requires Javascript to process</noscript>
  20. <div class='year'>
  21. <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-->
  22. <div id='firstyear' style='visibility:hidden'> <!-- initially invisible -->
  23. <input type='checkbox' value='filipino'>filipino<br>
  24. <input type='checkbox' value='math'>math<br>
  25. <input type='checkbox' value='sci'>science<br>
  26. </div></div>
  27. <div class='year'>
  28. <a href='#' onfocus="showIt('secondyear');" onclick="showIt('secondyear');" onblur="hideIt('secondyear');" taborder=2>second Year</a>
  29. <div id='secondyear' style='visibility:hidden'>
  30. <input type='checkbox' value='filipino'>2filipino<br>
  31. <input type='checkbox' value='math'>2math<br>
  32. <input type='checkbox' value='sci'>2science<br>
  33. </div></div>
  34. <div class='year'>
  35. <a href='#' onfocus="showIt('thirdyear');" onclick="showIt('thirdyear');" onblur="hideIt('thirdyear');" taborder=3>third Year</a>
  36. <div id='thirdyear' style='visibility:hidden'>
  37. <input type='checkbox' value='filipino'>3filipino<br>
  38. <input type='checkbox' value='math'>3math<br>
  39. <input type='checkbox' value='sci'>3science<br>
  40. </div></div>
  41. </body</html>
the javacript will hide or show any number of div span p textarea
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
Thank you so much.its working now..hope to see you again.!

God bless.!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC