変数を作成し、targetForm
それを。でバインドしようとしましたsubmit()
。ただし、関数を呼び出して変数をトリガーしてフォームを送信すると、バインドされた関数は送信イベントをキャッチしません。
var targetForm;
function Add_Notice_Message(evt){
alert('set up form');
targetForm = document.notification_form;
targetForm.classname= 'TTWForm';
targetForm.method = "post";
targetForm.action = '';
targetForm.novalidate = '';
alert('beforesubmmit');
targetForm.submit();
}
$( targetForm ).bind(
"submit",
function( event ){
alert('submit');
var $form = $(this), type;
type = $form.find('#type').val();
var options = {
category:'projects',
message: 'Sample Notification'
};
notifications.createNotification(options);
return false;
}
);