11 years ago
3
Topic

I am trying to add a script to the field in the form SEBLOD, but for some reason this is not working.
I want the lyrics to become a field of another color, for example.

I'm doing this:

<?php 

defined( '_JEXEC' ) or die;

//FORM
$pn=$cck->renderField('asspf_pnome');
$sn=$cck->renderField('asspf_snome');
$cpf=$cck->renderField('asspf_cpf');
$rg=$cck->renderField('asspf_rg');
$ssp=$cck->renderField('asspf_ssp');
$an=$cck->renderField('asspf_aniversario');
$tr=$cck->renderField('asspf_telresidencial');
$tc=$cck->renderField('asspf_telcelular');
$ep=$cck->renderField('asspf_emailp');
$es=$cck->renderField('asspf_emails');
$p=$cck->renderField('asspf_pais');
$cep=$cck->renderField('asspf_cep');
$rua=$cck->renderField('asspf_rua');
$ba=$cck->renderField('asspf_bairro');
$ci=$cck->renderField('asspf_cidade');
$uf=$cck->renderField('asspf_uf');
$cq=$cck->renderField('asspf_cq');
$sub=$cck->renderField('asspf_btsubmeter');
?>

<script type='text/javascript' src='http://code.jquery.com/jquery-1.5.1.min.js'></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>


//MY SCRIPT
<script>
$(document).ready(function() {

document.getElementsByName('<?php echo $cck->get('asspf_cq')->name; ?>').style.backgroundcolor="red";

});
</script>



//IN THE SITE SHOW
<?php
echo $pn;
echo $sn;
echo $cpf;
echo $rg;
echo $ssp;
echo $an;
echo $tr;
echo $tc;
echo $ep;
echo $es;
echo $p;
echo $cep;
echo $rua;
echo $ba;
echo $ci;
echo $uf;
echo $cq;
echo $sub;
//ADICIONANDO GRUPOS AO SISTEMA DE CADASTRO ASSINATURA PESSOA FÍSICA -----------------------------------
/*$db = JFactory::getDBO();
$query = 'SELECT userid FROM  mv478_session WHERE client_id=0';
$db->setQuery($query);
$nome_sess = $db->loadResult();
$query = 'INSERT INTO #__user_usergroup_map VALUES ('.$nome_sess.', 13)' ;
$db->setQuery($query);
*/
//--------------------------------------------------------------------------------------------------------
?>

Get a VIP membership
251 Posts
Viktor Iwan
11 years ago
0
Level 1

In seblod, you should use jQuery() instead of $() because joomla 3.1.1 is not still mootools free, its probably full jQuery in 3.2

251 Posts
Viktor Iwan
11 years ago
1
Level 1

Also, In order to load jQuery,  use JHtml::_('jquery.framework') instead of loading it manually

85 Posts
Jpeg
11 years ago
0
Level 2

Hi All,

please use :

JCck::loadjQuery();
to load the jQuery library by seblod


Jpeg

Get a VIP membership