I want to invoke the Janrain Social share widget on submission of a form that I have created in Drupal. I have tried the following options - Created a function around the social share javascript widget and tried invoking this function on an onclick event on the Submit button, as well as calling the function through the standard myform_submit function. But none of these invokes the widget, which is a pop up..following is the code..any help is welcome
......
......
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#attributes' => array(
'onclick' => 'callshare();'),
);
return $form;
}
OR
function myform_submit($form, &$form_state) {
callshare();
}
JAvascript 1
var rpxJsHost = (("https:" == document.location.protocol) ? "https://" : "http://static.");
document.write(unescape("%3Cscript src='" + rpxJsHost + "rpxnow.com/js/lib/rpx.js' type='text/javascript'%3E%3C/script%3E"));
Javascript 2
RPXNOW.init({appId: 'myappid',
xdReceiver: '/rpx_xdcomm.html'});
Javascript 3 ( below widget to be invoked)
function callshare(){
RPXNOW.loadAndRun(['Social'], function () {