?
Hello developers.
At RC1.9 I could use PHP code and JS code together in the field Custom code and all works fine. There is special action Load JS at RC 2.0 for javascript. Now I've separated my code for php and html to Custom code and javascript to Load JS and form doesn't react. When I see into the page code I find that onClick = "myfunction();" event is moved from my custom submit button code. So that is the reason of dead form. In Forms manager I see Admin View Functions and Data View Functions/ May be these new features impact on my code? If you need I can open login to admin panel.
This is my html and php code
This is my JS code
At RC1.9 I could use PHP code and JS code together in the field Custom code and all works fine. There is special action Load JS at RC 2.0 for javascript. Now I've separated my code for php and html to Custom code and javascript to Load JS and form doesn't react. When I see into the page code I find that onClick = "myfunction();" event is moved from my custom submit button code. So that is the reason of dead form. In Forms manager I see Admin View Functions and Data View Functions/ May be these new features impact on my code? If you need I can open login to admin panel.
This is my html and php code
<?php
$hostname = "localhost";
$username = "***";
$password = "***";
$db = "****";
$userstable1 = "personal";
$userstable2 = "data";
$userstable3 = "key_city";
$userstable4 = "lgot";
$userstable5 = "pir";
$userstable6 = "paysystem";
$user = &JFactory::getUser();
$usid = $user->id;
//Получение данных о пользователе из БД Joomla - лицевой счет
$dba = &JFactory::getDBO();
$dba->setQuery(
'SELECT `profile_value` FROM `#__user_profiles`' .
' WHERE `user_id` = '.(int) $usid." AND `profile_key` LIKE 'profile.favoritebook'" .
' ORDER BY ordering'
);
$lic = $dba->loadResult();
//Получение данных о пользователе из БД Joomla - город
$dba->setQuery(
'SELECT `profile_value` FROM `#__user_profiles`' .
' WHERE `user_id` = '.(int) $usid." AND `profile_key` LIKE 'profile.city'" .
' ORDER BY ordering'
);
$city = $dba->loadResult();
//Соединение с БД реализации
$connection=mysql_connect($hostname,$username,$password) OR DIE("ne mogu sozdat connection s bazoy");
mysql_select_db($db, $connection) or die("<br />ne mogu vybrat database<br />");
//Выбор данных о пользователе по лицевому коду - уникальный номер, код коатуу, город
$query3 = "SELECT `СITY_NAME`,`NOMER`, `KOATUU` FROM $userstable3 WHERE `KOD` = $lic";
$res3 = mysql_query($query3)or die("<br />ne mogu vypolnit zapros k tablice 3<br />");
while ($row3 = mysql_fetch_array($res3)){
$cityname = $row3['CITY_NAME'];
$nomer = $row3['NOMER'];
$city = $row3['KOATUU'];
}
mysql_free_result($res3);
//Выбор данных о пользователе - адрес, улица, дом, квартира
$query1 = "SELECT `KOD`, `FIO_VLAD`, `UL`, `N_HOUSE`, `F_HOUSE`, `D_HOUSE`, `N_ROOM`, `A_ROOM` FROM $userstable1 WHERE (`KOD` = $lic and `NOMER` = $nomer)";
$res1 = mysql_query($query1) or die("<br />ne mogu vypolnit zapros k tablice 1<br />");
while ($row1=mysql_fetch_array($res1))
{
echo "<strong>Лицевой счет: </strong> ".$row1['KOD']."</br> ";
echo "<strong>Владелец: </strong> ".$row1['FIO_VLAD']."</br> ";
echo "<strong>Местонахождение: </strong> ".$cityname." ";
echo "Ул.".$row1['UL']." ";
echo "д.".$row1['N_HOUSE']."";
if ($row1['A_HOUSE'] != 0) echo ("-".$row1['A_HOUSE']."");
if ($row1['F_HOUSE'] != 0) echo ("/".$row1['F_HOUSE']." ");
if ($row1['D_HOUSE'] != 0) echo ("корпус".$row1['D_HOUSE']."</br> ");
if ($row1['N_ROOM'] != 0) echo ("кв.".$row1['N_ROOM']."");
if ($row1['A_ROOM'] != 0) echo ("-".$row1['A_ROOM']."</br> ");
}
//Выбор данных о пользователе - тариф, задолженность, водомер и т.д.
$query2 = "SELECT `TARIF_V`, `TARIF_S`, `SUMM_DOLG`, `PR_VODOSN`, `END_COUNT`, `D_SNPOK`, `VODA_GRN`, `POLIV_GRN`, `DOP_GRN`, `DOLG_REST`, `SUMM_DOLG_`, `KAN_GRN_X`, `KAN_GRN_G`, `LGOTA`, `NACH_SHTR`, `NACH_PEN`, `SUMM_MONTH`, `PRICHINA`, `IZM_GRN`, `IZMK_GRN` FROM `$userstable2` WHERE `NOMER` = $nomer";
$res2 = mysql_query($query2) or die("<br />ne mogu vypolnit zapros k tablice2<br />");
while ($row2=mysql_fetch_array($res2))
{
echo "<strong><br/>Ваш тариф за водоснабжение: </strong> ".$row2['TARIF_V']."грн/куб.м";
if ($row2['TARIF_S'] != 0) {echo ("за водоотведение (стоки)".$row2['TARIF_S']."грн/куб.м");}
if ($row2['SUMM_DOLG']>0) {echo "<strong><br />Задолженность на начало месяца: </strong> ".sprintf("%.02f",$row2['SUMM_DOLG'])."грн ";}
elseif ($row2['SUMM_DOLG']<=0){echo "<strong><br />У вас нет задолженности</strong> ";}
$schetchik=$row2['PR_VODOSN'];
echo "<br/><strong>Начисление осуществляется: </strong> ";
if ($row2['PR_VODOSN'] == 0) {echo ("по норме");}
elseif ($row2['PR_VODOSN'] == 1) {echo ("по личному водомеру");}
else {echo ("по общественному водомеру");}
if ($row2['PR_VODOSN'] > 0) {echo ("<strong><br />Последние показания счетчика: </strong> ".$row2['END_COUNT']." на дату ".$row2['D_SNPOK']);}
$summdolg = $row2['SUMM_DOLG'];/*задолженность на начало месяца с учетом льгот грн*/
$vodagrn = $row2['VODA_GRN'];/*вода грн*/
$polivgrn = $row2['POLIV_GRN'];/*полив грн*/
$dopgrn = $row2['DOP_GRN'];/*дополнительное водопотребление грн*/
$dolgrest = $row2['DOLG_REST'];/*долг по договору реструктуризации грн*/
$sumgrest = $row2['SUMM_DOLG_'];/*сумма по договору реструктуризации грн*/
$kangrnx = $row2['KAN_GRN_Х'];/*стоки холодная вода грн*/
$kangrng = $row2['KAN_GRN_G'];/*стоки горячая вода грн*/
$lgota = $row2['LGOTA'];/*льгота к возмещению грн*/
$nachshtr = $row2['NACH_SHTR'];/*начисленная сумма штрафа грн*/
$nachpen = $row2['NACH_PEN'];/*начисленная сумма пени грн грн*/
$summmonth = $row2['SUMM_MONTH'];/*всего начислено к оплате грн*/
$prichina = $row2['PRICHINA'];/*причина перерасчетов*/
$izmgrn = $row2['IZM_GRN'];/*всего перерасчетов грн*/
$izmgrnk = $row2['IZM_GRNK'];/*перерасчетов по канализации грн*/
$tarifvoda = $row2['TARIF_V'];/*Действующий тариф за 1м3 воды */
$tarifstok = $row2['TARIF_S'];/*Действующий тариф за 1м3 стоков*/
$endcount = $row2['END_COUNT'];/*Последнее показание счетчика*/
$dnspok = $row2['D_SNPOK'];/*Дата снятия показания счетчика*/
}
//Выбор данных о пользователе - данные о претензионно исковой работе
$query5 = "SELECT `S_RES_SUD`, `S_POGASH` FROM $userstable5 WHERE `nomer` = $nomer";
$res5 = mysql_query($query5) or die("ne mogu vypolnit zapros k tablice5");
while ($row5=mysql_fetch_array($res5))
{
$sressud = $row5['S_RES_SUD'];/*сумма задолженности по решению суда грн*/
$spogash = $row5['S_POGASH'];/*сумма погашения задолженности грн*/
$spir = $sressud - $spogash;
}
$osnplateg = $vodagrn+$polivgrn+$dopgrn+$kangrnx+$kangrng+$nachpen-$lgota;/*Основные платежи;*/
$dopplateg = $nachshtr+$dolgrest+$spir;// Отдельно за ПИР, договор реструктуризации и штраф
$arraylgota =array("-",$lgota);
$plateg = $osnplateg+$dopplateg;
//Закрытие соединения с БД реализации
/*$connection=mysql_close($hostname,$username,$password) OR DIE("ne mogu sozdat connection ");
mysql_select_db($db) or die(mysql_error("ne mogu vybrat database")); */
//echo '8';
?>
<p><center><strong>Текущие платежи</strong></center></p>
<table style="text-align: left; width: 100%; cellpadding:3px; border-collapse: collapse" border="1" cellpadding="2" cellspacing="0" >
<tbody>
<tr style="background:#B2C8D5;">
<td><strong>Назначение платежа</strong></td>
<td colspan="2" rowspan="1"><strong>Сумма</strong></td>
</tr>
<?php if (($vodagrn != 0) and(($kangrnx !=0) or ($kangrng !=0))) echo ('<tr><td>за воду и стоки</td><td colspan="2" rowspan="1">'.sprintf("%.02f",$vodagrn).' грн</td></tr>');?>
<?php if ($vodagrn != 0) echo ('<tr><td>за воду</td><td colspan="2" rowspan="1">'.sprintf("%.02f",$vodagrn).' грн</td></tr>');?>
<?php if ($kangrnx !=0) echo ('<tr><td>за стоки холодной воды</td><td colspan="2" rowspan="1">'.sprintf("%.02f",$kangrnx).' грн</td></tr>');?>
<?php if ($kangrng !=0) echo ('<tr><td>за стоки гарячей воды</td><td colspan="2" rowspan="1">'.sprintf("%.02f",$kangrng).' грн</td></tr>');?>
<?php if ($polivgrn !=0) echo ('<tr><td>за полив</td><td colspan="2" rowspan="1">'.sprintf("%.02f",$polivgrn).' грн</td></tr>');?>
<?php if ($nachpen !=0) echo ('<tr><td>пеня</td><td colspan="2" rowspan="1">'.sprintf("%.02f",$nachpen).' грн</td></tr>');?>
<?php if ($lgota !=0) echo ('<tr><td>льгота в денежном выражении</td><td colspan="2" rowspan="1">'.sprintf("%.02f",implode($arraylgota)).' грн</td></tr>');?>
<tr>
<td><strong>Итого</strong></td>
<td><strong><?php echo (sprintf("%.02f",$osnplateg)." грн"); ?></strong></td>
<td width="90px"><center><input name="osnplateg" value="<?php echo $osnplateg ;?>" id="osn_sum" type="checkbox" checked onClick="boxcheck();" ><strong>Оплатить<strong></center></td>
</tr>
</tbody>
</table>
<?php //Таблица дополнительных платежей
if ($dopplateg !=0) echo ('<p><center><strong>Дополнительные платежи</strong></center></p>
<table style="text-align: left; width: 100%; cellpadding:3px; border-collapse: collapse" border="1" cellpadding="2" cellspacing="0">
<tbody>
<tr style="background:#B2C8D5;">
<td><strong>Назначение платежа</strong></td>
<td><strong>Сумма</strong></td>
<td width="90px"><strong>Оплатить</strong></td>
</tr>'); ?>
<?php if ($dolgrest !=0) echo ('<tr><td>по договору реструктуризации</td><td>'.sprintf("%.02f",$dolgrest).' грн</td>
<td><center><input name="dolgrest" value="'.$dolgrest.'" id="check_dogrest" type="checkbox" onClick="boxcheck();"></center></td></tr>');?>
<?php if ($nachshtr !=0) echo ('<tr><td>штраф</td><td>'.sprintf("%.02f",$nachshtr).' грн</td>
<td><center><input name="nachshtr" value="'.$nachshtr.'" id="check_shtraf" type="checkbox" onClick="boxcheck();"></center></td></tr>');?>
<?php if ($spir > 0) echo ('<tr><td>по решению суда</td><td>'.sprintf("%.02f",$spir).' грн</td>
<td><center><input name="spir" value="'.$spir.'" id="check_pir" type="checkbox" onClick="boxcheck();"></center></td></tr>'); ?>
<?php if ($dopplateg !=0) echo (' <tr>
<td><strong>Итого</strong></td>
<td colspan="2" rowspan="1"><strong>'); ?> <?php if ($dopplateg !=0) echo (sprintf("%.02f",$dopplateg)." грн"); ?> <?php if ($dopplateg !=0) echo ('</strong></td>
</tr>
</tbody>
</table> '); ?>
<?php // Вывод суммы к оплате по норме
if ($schetchik == 0) echo '<div class="ccms_form_element" id="recomend"><strong>Сумма рекомендованная к оплате: </strong>'.sprintf("%.02f",$plateg).
' грн<p><strong>Вы оплачиваете </strong><input value="" name = "final_sum" id="finalsum" type="text" size="8" > грн</p></div>';
?>
<div>
<?php if($schetchik != 0) echo ('<br />Показания счетчика <input type="number" id="meter" name="meter" value="" title="Вводите только целые числа. Две последние быстроменяющиеся красные цифры на счетчике не подлежат вводу." size="10" />
<input type="button" id="metersubmitbtn" name="metersubmitbtn" value="Ввести" >');
?>
<div id="itog"> </div>
</div>
<div>
Оплатить с помощью
<select id="paysystem" name="paysystem">
<option id="Portmone" name="agent" value="Portmone">Portmone</option>
<option id="LiqPAY" name="agent" value="LiqPAY">LiqPAY</option>
<option id="CoPAYCo" name="agent" value="CoPAYCo">CoPAYCo</option>
<option id="Ipay" name="agent" value="Ipay">Ipay</option>
</select>
<p><input name="platasubmitbtn" id="platasubmitbtn" type ="button" value="Заплатить" onClick="finalsubmit();"/></p>
</div>
This is my JS code
<?php
$hostname = "localhost";
$username = "***";
$password = "***";
$db = "***";
$userstable2 = "data";
$userstable3 = "key_city";
$user = &JFactory::getUser();
$usid = $user->id;
//Получение данных о пользователе из БД Joomla - лицевой счет
$dba = &JFactory::getDBO();
$dba->setQuery(
'SELECT `profile_value` FROM `#__user_profiles`' .
' WHERE `user_id` = '.(int) $usid." AND `profile_key` LIKE 'profile.favoritebook'" .
' ORDER BY ordering'
);
$lic = $dba->loadResult();
//Получение данных о пользователе из БД Joomla - город
$dba->setQuery(
'SELECT `profile_value` FROM `#__user_profiles`' .
' WHERE `user_id` = '.(int) $usid." AND `profile_key` LIKE 'profile.city'" .
' ORDER BY ordering'
);
$city = $dba->loadResult();
//Соединение с БД реализации
$connection=mysql_connect($hostname,$username,$password) OR DIE("ne mogu sozdat connection s bazoy");
mysql_select_db($db, $connection) or die("<br />ne mogu vybrat database<br />");
//Выбор данных о пользователе по лицевому коду - уникальный номер, код коатуу, город
$query3 = "SELECT `NOMER` FROM $userstable3 WHERE `KOD` = $lic";
$res3 = mysql_query($query3)or die("<br />ne mogu vypolnit zapros k tablice 3<br />");
while ($row3 = mysql_fetch_array($res3)){
//if (!$row3 = mysql_fetch_array ($res3)) echo "Возникла ошибка - ".mysql_error()."<br>";
$nomer = $row3['NOMER'];
}
mysql_free_result($res3);
//Выбор данных о пользователе - тариф, задолженность, водомер и т.д.
$query2 = "SELECT `PR_VODOSN`, `TARIF_V`, `TARIF_S` FROM `$userstable2` WHERE `NOMER` = $nomer";
$res2 = mysql_query($query2) or die("<br />ne mogu vypolnit zapros k tablice2<br />");
while ($row2=mysql_fetch_array($res2))
{
$schetchik=$row2['PR_VODOSN'];
$tarifvoda = $row2['TARIF_V'];/*Действующий тариф за 1м3 воды */
$tarifstok = $row2['TARIF_S'];/*Действующий тариф за 1м3 стоков*/
}
?>
function boxcheck(){if(document.getElementById('osn_sum').checked) { var osnplateg = document.getElementById('osn_sum').value;}
else {var osnplateg =0;}
if(document.getElementById('check_dogrest') && document.getElementById('check_dogrest').checked) { var dogrest = document.getElementById('check_dogrest').value;}
else {var dogrest =0;}
if(document.getElementById('check_pir') && document.getElementById('check_pir').checked) { var pir = document.getElementById('check_pir').value;}
else {var pir =0;}
if(document.getElementById('check_shtraf') && document.getElementById('check_shtraf').checked) { var shtraf = document.getElementById('check_shtraf').value;}
else {var shtraf =0;}
sumfinal = parseFloat(osnplateg)+parseFloat(dogrest)+parseFloat(pir)+parseFloat(shtraf);
document.getElementById("finalsum").value=sumfinal.toFixed(2);
}
function metersubmit()
{
tarifvoda=<?php if ($tarifvoda !=0) {echo $tarifvoda;} else {echo "0";} ?>;
tarifstok=<?php if ($tarifstok !=0) {echo $tarifstok;} else {echo "0";} ?>;
metervalue=document.getElementById('meter').value;
var platamt=metervalue*(tarifvoda+tarifstok)/1000;
platameter=platamt.toFixed(2);
document.getElementById('itog').innerHTML = '<p>Сумма рекомендуемая к оплате '+platameter+' грн</p>';
document.getElementById('itog').innerHTML += '<p><strong>Вы оплачиваете </strong> <input value='+platameter+' name="platamtr" id="platamtr" type="text" size="8" required="required" pattern="[0-9]" title="Сумма вводится с точностью до копейки. Копейки вводите через точку. Например, 46.00 грн или 127.86 грн" ?> грн</p>';
}
function finalsubmit()
{
schetchik=<?php echo $schetchik ;?>;
if (schetchik>0)
{
if(document.getElementById('itog').checked) { var osnplateg = 'Вы ввели показания счетчика '+document.getElementById('meter').value+'\nтекущие платежи '+parseFloat(document.getElementById('platamtr').value).toFixed(2)+' грн';}
else {var osnplateg ='';}
if(document.getElementById('check_dogrest') && document.getElementById('check_dogrest').checked) { var dogrest = '\nпо договору реструктуризации долга '+parseFloat(document.getElementById('check_dogrest').value).toFixed(2)+' грн';}
else {var dogrest ='';}
if(document.getElementById('check_pir') && document.getElementById('check_pir').checked) { var pir = '\nпо решению суда '+parseFloat(document.getElementById('check_pir').value).toFixed(2)+' грн';}
else {var pir ='';}
if(document.getElementById('check_shtraf') && document.getElementById('check_shtraf').checked) { var shtraf = '\nштраф '+parseFloat(document.getElementById('check_shtraf').value).toFixed(2)+' грн';}
else {var shtraf ='';}
var result=confirm('Вы оплачиваете '+document.getElementById('platamtr').value+' грн'+'\nВ том числе'+osnplateg+dogrest+pir+shtraf+'\nс помощью системы '+document.getElementById('paysystem').value+'\nЕсли все правильно - нажмите ОК');
if (result)
{
var cbx=document.getElementById('paysystem');
if (cbx) {
switch (cbx.options[cbx.options.selectedIndex].value) {
case "Portmone":
alert ('Сейчас Вы будете перенаправлены в новой вкладке на страницу платежной системы для завершения оплаты');
window.open("http://www.portmone.com.ua","Portmone");
break;
case "LiqPAY":
alert ('Сейчас Вы будете перенаправлены в новой вкладке на страницу платежной системы для завершения оплаты');
window.open("http://privatbank.ua","LiqPAY");
break;
case "CoPAYCo":
alert ('Сейчас Вы будете перенаправлены в новой вкладке на страницу платежной системы для завершения оплаты');
window.open("https://www.copayco.com","CoPAYCo");
break;
case "Ipay":
alert ('Сейчас Вы будете перенаправлены в новой вкладке на страницу платежной системы для завершения оплаты');
window.open("http://www.ipay.ua","Ipay");
break;
}
document.cabinet.submit();
}
}
}
else
{
if(document.getElementById('osn_sum').checked) { var osnplateg = '\nтекущие платежи '+parseFloat(document.getElementById('osn_sum').value).toFixed(2)+' грн';}
else {var osnplateg ='';}
if(document.getElementById('check_dogrest') && document.getElementById('check_dogrest').checked) { var dogrest = '\nпо договору реструктуризации долга '+parseFloat(document.getElementById('check_dogrest').value).toFixed(2)+' грн';}
else {var dogrest ='';}
if(document.getElementById('check_pir') && document.getElementById('check_pir').checked) { var pir = '\nпо решению суда '+parseFloat(document.getElementById('check_pir').value).toFixed(2)+' грн';}
else {var pir ='';}
if(document.getElementById('check_shtraf') && document.getElementById('check_shtraf').checked) { var shtraf = '\nштраф '+parseFloat(document.getElementById('check_shtraf').value).toFixed(2)+' грн';}
else {var shtraf ='';}
var result=confirm('Вы оплачиваете '+document.getElementById('finalsum').value+' грн'+'\nВ том числе'+osnplateg+dogrest+pir+shtraf+'\nс помощью системы '+document.getElementById('paysystem').value+'\nЕсли все правильно - нажмите ОК');
if (result)
{
alert ('Сейчас Вы будете перенаправлены в новой вкладке на страницу платежной системы для завершения оплаты');
var cbx=document.getElementById('paysystem');
if (cbx) {
switch (cbx.options[cbx.options.selectedIndex].value) {
case "Portmone":
window.open("http://www.portmone.com.ua","Portmone");
break;
case "LiqPAY":
window.open("http://privatbank.ua","LiqPAY");
break;
case "CoPAYCo":
window.open("https://www.copayco.com","CoPAYCo");
break;
case "Ipay":
window.open("http://www.ipay.ua","Ipay");
break;
}
document.cabinet.submit();
}
}
}
}
Hi Roman Petrenko,
The JS Load action has been there since the first release of CFv4, it's not new in RC2.0. You are not required to use it, you can still include JavaScript in the Form HTML if you prefer.
I did my best to test your code here and the onClick is not removed when the form is displayed. I had to remove the PHP running the queries so it's possible that there is some bug in there that affects the display though that seems unlikley.
Bob
PS I suggest that it might be more secure if you used the Joomla! database queries rather than hand-coding them.
The JS Load action has been there since the first release of CFv4, it's not new in RC2.0. You are not required to use it, you can still include JavaScript in the Form HTML if you prefer.
I did my best to test your code here and the onClick is not removed when the form is displayed. I had to remove the PHP running the queries so it's possible that there is some bug in there that affects the display though that seems unlikley.
Bob
PS I suggest that it might be more secure if you used the Joomla! database queries rather than hand-coding them.
?
Hi GreyHead.
Thank for your answer.
I've realy made mistake concerning action Load JS, yes it was earlier. But there is strange behaviour of my form. If I put all my code (php+html+js) into field Custom code then something cut both tags <script type="text/javascript"> and </script>. I've read about mootools and jquery conflicts but I think there is something else because in conflict case js code stay uncutted. I also switch off such plugin like Marco's SQL Injection - LFI Interceptor and jHackGuard 1.6 but no result (it impact on php). May be you know from your experience what can impact and cut the JS tags? Now it looks like this.
Thank for your answer.
I've realy made mistake concerning action Load JS, yes it was earlier. But there is strange behaviour of my form. If I put all my code (php+html+js) into field Custom code then something cut both tags <script type="text/javascript"> and </script>. I've read about mootools and jquery conflicts but I think there is something else because in conflict case js code stay uncutted. I also switch off such plugin like Marco's SQL Injection - LFI Interceptor and jHackGuard 1.6 but no result (it impact on php). May be you know from your experience what can impact and cut the JS tags? Now it looks like this.
Hi Roman,
I find it really hard to understand what you are tyring to do here. It seems as though you are putting random chunks of code in different boxes.
If you want to use Custom HTML + PHP + JavaScript then you can do all of that in the Form Code box (click the Name tag in the Forms Manager to access it).
If you want to use the Wizard for most Form elements and add some Customised Elements then use the Custom Element for that.
If you want to add a block of JavaScript to your form then use the Load JS action.
If you want to add a block of PHP to pre-process some data then use the Custom Code action.
Bob
PS I don't have any problem with script tags in the Custom Code action; I've just tested and they work OK. But I would probably use the Load JS action; or the Joomla! $doc->addScript() method instead.
I find it really hard to understand what you are tyring to do here. It seems as though you are putting random chunks of code in different boxes.
If you want to use Custom HTML + PHP + JavaScript then you can do all of that in the Form Code box (click the Name tag in the Forms Manager to access it).
If you want to use the Wizard for most Form elements and add some Customised Elements then use the Custom Element for that.
If you want to add a block of JavaScript to your form then use the Load JS action.
If you want to add a block of PHP to pre-process some data then use the Custom Code action.
Bob
PS I don't have any problem with script tags in the Custom Code action; I've just tested and they work OK. But I would probably use the Load JS action; or the Joomla! $doc->addScript() method instead.
?
Hi GreyHead.
I tried 3 different methods:
1) form type -> wizzard (extended)/ Elements -> Custom element (my html + php + js)
2) form type -> wizzard (extended)/ Elements -> Custom element (my html + php) and Action -> Load JS (my js code)
3) form type -> custom / Tab -> Code /Field -> HTML code (my html + php + js)
And I have:
1)There are cutted js event onclick and onsubmit in all cases.
2)There are cutted tags <script type="text/javascript"> and </script> in 1) and 3) cases.
So I can't find yet what impact on javascript? May be the problem with my webserver ore with my joomla 1.7 installation...
I tried 3 different methods:
1) form type -> wizzard (extended)/ Elements -> Custom element (my html + php + js)
2) form type -> wizzard (extended)/ Elements -> Custom element (my html + php) and Action -> Load JS (my js code)
3) form type -> custom / Tab -> Code /Field -> HTML code (my html + php + js)
And I have:
1)There are cutted js event onclick and onsubmit in all cases.
2)There are cutted tags <script type="text/javascript"> and </script> in 1) and 3) cases.
So I can't find yet what impact on javascript? May be the problem with my webserver ore with my joomla 1.7 installation...
Hi Roman,
I tested today both the Custom Code and the HTML Code box and in both cases script tags are saved correctly and the JavaScript runs :-(
Bob
I tested today both the Custom Code and the HTML Code box and in both cases script tags are saved correctly and the JavaScript runs :-(
Bob
?
Hi Bob
The problem was in plugin Marco's SQL Injection - LFI Interceptor. I setup com_chronoforms as ignored extension but this doesn't work. Finally I switched off the plugin and cleaned the cash of server and browser repaired my code and start again and it worked.
The problem was in plugin Marco's SQL Injection - LFI Interceptor. I setup com_chronoforms as ignored extension but this doesn't work. Finally I switched off the plugin and cleaned the cash of server and browser repaired my code and start again and it worked.
This topic is locked and no more replies can be posted.