/    Sign up×
Community /Pin to ProfileBookmark

Novice Javascript and Jquery

I’m looking into a way to separate out the pieces of an address to then be entered into a single line application called Matukio events on a Joomla site. The idea is to use Jquery and javascript to take other separate fields to then be entered into the single address field. Here is an image of the database https://drive.google.com/a/directive.com/file/d/1O72jjzc5pAa7kK_Xj99phFALzsT5Nnc_/view?usp=drivesdk

Here are the fields on the front end that I’m filling with the address from the multiple fields https://drive.google.com/a/directive.com/file/d/1e_DMM1uOE47zJIGkwH4YcKdRoWxlj4hm/view?usp=drivesdk

here are the multiple fields https://drive.google.com/a/directive.com/file/d/1Oi9qBG24JBuM_9dKu5buLVAGLiWNGEZD/view?usp=drivesdk

So the stuff entered into the multiple fields would be entered into the single field after we click on the submit `button.

`class plgSystemEventLocation extends JPlugin
{
var $params = null;

/**
* Method is called by index.php and administrator/index.php
*
* @access public
*/
public function onAfterDispatch()
{
$app = JFactory::getApplication();
if($app->getName() == ‘administrator’) {
//return true;
}

$option = JRequest::getVar(‘option’);
$view = JRequest::getVar(‘view’);
$task = JRequest::getVar(‘task’);
$layout = JRequest::getVar(‘layout’);
$doc = JFactory::getDocument();
if ($option == ‘com_matukio’ && $view == ‘submit’)
{
$cssCode = ”;
$doc->addStyleDeclaration($cssCode);

$jsCode = ‘var jQuery = jQuery.noConflict();
jQuery(document).ready(function($) {
jQuery(window).load(function() {
jQuery(“#btnFinish”).click(function(){


var addressline = jQuery(“#jform_customfields_address”).val();
var city = jQuery(“#jform_customfields_city”).val();
var state = jQuery(“#jform_customfields_state”).val();
var zip = jQuery(“#jform_customfields_zipcode”).val();

var com_addr = addressline+”, “+city+” “+state+” “+zip;
jQuery(“#place, #gmaploc”).val(com_addr);
jQuery(“#gmaploc”).keyup();


//return false;
});
});
});’;
$doc->addScriptDeclaration($jsCode);



}

return true;
}
}`

I will be the first to admit that I have limited knowledge of what the issue is but wanted to be sure that maybe I wasn’t missing something in the code.

Thanks,

to post a comment
Full-stack DeveloperJavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@wleksinMar 01.2020 — it's my first time to see developp good [walmart one](https://walmartone.me/) website for coding in georgian 🙂/
Copy linkTweet thisAlerts:
@john143Jul 15.2020 — Its really very helpful [tesco activation](https://www.payslipviews.co.uk/tesco-activation-code/) web for coding in georgian ::
Copy linkTweet thisAlerts:
@john143Mar 16.2021 — I really thankful to u 😃

[asda walmartone](https://azpayslips.co.uk/asda-walmart-one/)
×

Success!

Help @kenechard spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...