Jump to content

form setting to toggle on html

Featured Replies

Posted

Is there a way to toggle on a $form->addHtml(' '); in the settings, for example

$form->add( new \IPS\Helpers\Form\YesNo( 'ShowHTMLForm', \IPS\Settings::i()->ShowHTMLForm, FALSE, array('togglesOn' => array( 'The_setting_below' ) ) ) );

$form->addHtml('I want this to display if ShowHTMLForm = 1 ');

 

I don't think so. There is no any id:

	/**
	 * Add Html
	 *
	 * @param	string	$html		HTML to add
	 * @return	void
	 */
	public function addHtml( $html )

 

$form->add( new \IPS\Helpers\Form\YesNo( 'ShowHTMLForm', \IPS\Settings::i()->ShowHTMLForm, FALSE, array('togglesOn' => array( 'my_custom_id' ) ) ) );

$form->addHtml('<div id="my_custom_id">Text</div>');

 

  • Author
4 minutes ago, newbie LAC said:

$form->add( new \IPS\Helpers\Form\YesNo( 'ShowHTMLForm', \IPS\Settings::i()->ShowHTMLForm, FALSE, array('togglesOn' => array( 'my_custom_id' ) ) ) );

$form->addHtml('<div id="my_custom_id">Text</div>');

 

Perfect your a legend thanks

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.