vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help with onclick to load calendar (https://vborg.vbsupport.ru/showthread.php?t=279319)

Shadow666 02-29-2012 03:08 AM

Help with onclick to load calendar
 
Hi,

I am trying to add yes/no radio buttons in the admincp, using the 'function print_yes_no_row'.

How can I get the 'NO' radio button to load the 'function print_time_row' and if the 'YES' radio button is selected to clear the print_time_row.

I have tried using the 'ONCLICK' in the 'function print_yes_no_row', but I can't get it to work.

Hopefully someone can help with this, please.

Thanks.

kh99 02-29-2012 03:43 AM

You'd need to write some javascript to do that. What you put for onclick has to be javascript code that will run in the user's browser, not a php function.

You could do what you want to do by having javascript to hide and show (or gray out) the time row depending on the state of the radio buttons. I know the notice manager grays out the options that don't have the checkbox checked, so you might look in notice.php to see how that's done.

Shadow666 02-29-2012 12:16 PM

Quote:

Originally Posted by kh99 (Post 2304513)
You'd need to write some javascript to do that. What you put for onclick has to be javascript code that will run in the user's browser, not a php function.

You could do what you want to do by having javascript to hide and show (or gray out) the time row depending on the state of the radio buttons. I know the notice manager grays out the options that don't have the checkbox checked, so you might look in notice.php to see how that's done.

Hi,

I have taken a look at the notice manager, but can't see it graying out anything when I don't have a box ticked.

kh99 02-29-2012 01:21 PM

Oh, yeah, that's probably because it only does it for certain browsers. But the code is in admincp/notice.php, around line 519 there's a comment that says "javascript to handle disabling elements for IE niceness" (I suppose it was written years ago and hasn't changed).

Shadow666 03-01-2012 01:13 AM

Thank you.


All times are GMT. The time now is 07:21 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01096 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete