Reputation: 514
function sendM() {
new Ajax.Request("sendm.html",
{
method: 'post',
postBody: 'text='+ $F('text') +'&sub='+ $F('subject') +'&sname='+ $F('name') +'&sfmail='+ $F('email') +'to='+ $F('to'),
onLoading:showLoad,
onComplete: showResponse
});
}
function showLoad(){
$('dresult').innerHTML= "מבצע את הפעולה <br /><br />";
}
function showResponse(req){
$('dresult').innerHTML= req.responseText;
}
The hTML Form code :
<form id="sfunc" name="sfunc" onsubmit="return false;">
שם
דוא"ל
יעד
1
2
3
נושא
הודעה
Upvotes: 0
Views: 197
Reputation: 20115
You attempted to use showLoad and showResponse before they were initialized. Move your function definitions for showLoad and showResponse above your Ajax request.
For future reference, note that any error occuring inside your Ajax handlers do not print out errors in your browser error console. You'll have to create breakpoints in the handlers to fix the problem. Use a debugger like Firefox's Firebug plugin.
Upvotes: -1