For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
jQuery("select#access_control_learners___dbj_elementname option").each( function() {
var optTxt = jQuery(this).text();
setTimeout(
function()
{
jQuery("input[id^='form_group_repeat___apprenant_']").each( function() {
if(jQuery(this).val() == ""){
jQuery(this).val(optTxt);
jQuery(this).attr('readonly','readonly');
return false;
} else {
jQuery(this).attr('readonly','readonly');
}
});
}, 2000);
});
Well I wouldn't go that far - but I do enjoy coming up with 'creative' solutions. So, no problem; Glad I could help.Thank you very much Bauer!!! It works like a charm! the '.each( function() {' solve my problem! You're a genius!
console.log("hey");
jQuery("select#tbl_work_sheets___im_data option").each( function() {
var optTxt = jQuery(this).text(); // get label of dropdown on parent
var optVal = jQuery(this).val(); // get value of dropdown on parent
setTimeout(
function()
{
jQuery("input[id^='tbl_work_sheets_56_repeat___im_description_']").each( function() {
if(jQuery(this).val() == ""){ // if the field is empty
jQuery(this).val(optVal); // insert value into im_description field to store in database
// write label to im_description label
//**not working** jQuery(this).text(optText);
//**not working** form.formElements.get('tbl_work_sheets_56_repeat___im_description').setLabel(optText);
//**not working** var label = document.getElementById('labeltbl_work_sheets_56_repeat___im_description');
//label.value=optText;
jQuery(this).attr('readonly','readonly');
return false;
} else {
jQuery(this).attr('readonly','readonly');
}
});
}, 2000);
});
$option = array(); //prevent problems
$option['driver'] = 'mysql';
$option['host'] = 'localhost'; // Database host name
$option['user'] = 'randomUser'; // User for database authentication
$option['password'] = 'password'; // Password for database authentication
$option['database'] = 'databaseName'; // Database name
$db = JDatabaseDriver::getInstance( $option );
$subQueryB = $db->getQuery(true);
$subQueryA = $db->getQuery(true);
$query = $db->getQuery(true);
$subQueryA->select('function')
->from($db->quoteName('tbl_vehicle_details'))
->where($db->quoteName('id') . ' = ' . $db->quote('{tbl_work_sheets___vehicle_raw}'));
$subQueryB->select('parent_id')
->from($db->quoteName('tbl_insarea_repeat_relevant_to_function'))
->where($db->quoteName('relevant_to_function') . ' IN (' . $subQueryA . ')');
// Create the base select statement.
$query->select('Count(*)')
->from($db->quoteName('tbl_insarea'))
//->where($db->quoteName('state') . ' = ' . $db->quote('1'))
->where($db->quoteName('id') . ' IN (' . $subQueryB . ')');
//->order($db->quoteName('ordering') . ' ASC');
// Set the query and load the result.
//$db->setQuery($subQueryA);
$db->setQuery($query);
//$db->setQuery($query);
try
{
$result = $db->loadResult();
}
catch (RuntimeException $e)
{
throw new RuntimeException($e->getMessage(), $e->getCode());
}
//$result = ('{tbl_work_sheets___vehicle_raw}');
return $result;
return "";
function populateImAreas(){
jQuery("select#tbl_work_sheets___im_data option").each( function() {
var optTxt = jQuery(this).text();
var optVal = jQuery(this).val();
setTimeout(
function()
{
jQuery("input[id^='tbl_work_sheets_59_repeat___im_id_']").each( function() {
if(jQuery(this).val() == ""){
jQuery(this).val(optVal);
return false;
}
});
jQuery("[id^='tbl_work_sheets_59_repeat___im_area_description_']").each( function() {
if(jQuery(this).text() == ""){
jQuery(this).text(optTxt);
return false;
}
});
},2000);
});