Keyword

Edit extra fields in backend item form

  • programador.5
  • programador.5's Avatar Topic Author
  • Offline
  • New Member
More
10 years 10 months ago #121785 by programador.5
Edit extra fields in backend item form was created by programador.5
Hello!

I'm currently trying to edit the backend item form (administrator/components/com_k2/views/item/tmp/default.php) in order to add a javascript call to a specific extra field, the code I'm using is as follows, in line 561 of the deafult.php file:
if($extraField->type == 'select'){
//Add jquery onchange function after <select string
        $needle="K2ExtraField_1";
	if (strpos ( $extraField->element , $needle )){
	$string=$extraField->element;
	$substr = '<select';
	$attachment = ' onchange="checkseleccion()"';
	$extraField->element = str_replace($substr, $substr.$attachment, $string);
	}
}

The code should add "onchange="checkseleccion()" " to an extra field with the id K2ExtraField_1, however it isn't working in the backend. In the front end submission form it works perfectly.

Is this the file I should be editing, or there's some other place where I can access the extra field code to add the function?

Thanks in advance!

Joomla: 3.1.5
K2: 2.6.7

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum