We have a CF4 set up where a user can select a client from a drop down. This then populates a 2nd drop down with only jobs that are associated with the selected client. This is all working great and for info code snippets are below:
This is LoadJS on the On Load event:
Some pointers would be good as to how to achieve this if you are able? I think that I probably need to add some JS as this would be an Ajax call but I dont know the code or whaere to add it.
Many thanks
This is LoadJS on the On Load event:
//and this is Custom Code on the job look up:
window.addEvent('load', function(){
document.id('Job_Name').addEvent('change:once', function() {
document.id('Job_Name').value = document.id('Job_NameTemp').value;
});
if( document.id('Job_NameTemp').value != '' ){
//alert( document.id('Job_NameTemp').value );
//alert( 'firing change event' );
document.id('Customer').fireEvent("change");
}
});
<?phpWhat I want to do is to display the content of another field in either HTML or a Text Box (whichever is easiest as it doesnt need to be editable) on screen when the user selects the job from this second drop down, which is being populated by Ajax calls. This other field contains details of the job itself, more instructions to the user if you wish. It is stored in the database in the same table as the job information that the second drop down uses.
$results = array();
// the next line set the first 'nothing selected' option.
$results[] = '=Please Select';
foreach ( $form->data['Job_NameLookup'] as $v ) {
$results[] = $v['cf_id'].'='.$v['Job_Name'];
}
$results = implode("\n", $results);
echo $results;
$mainframe =& JFactory::getApplication();
$mainframe->close();
?>
Some pointers would be good as to how to achieve this if you are able? I think that I probably need to add some JS as this would be an Ajax call but I dont know the code or whaere to add it.
Many thanks