luke83
7 Nov 2006, 6:56 AM
i have this code:
index.htm
App = function(){
[...]
var rmsg = new function(){
this.render = function(el, response){
var obj = response.responseText; // JSON data
alert(obj)
}
}();
[...]
sMsg : function(){
sm=getEl('msg_form').getUpdateManager();
sm.setRenderer(rmsg);
sm.formUpdate("msg_form","msg.php",true);
},
[...]
send (#)
<form id="msg_form" name="msg_form">
<input type="hidden" name="act" value="add"/>
<textarea id="msg_in" name="txt"></textarea>
</form>
<div id="sm"></div>
msg.php:
<?
[...]
echo $_REQUEST['txt'];
?>
what i would?
when a user compile the textarea and click on link "send" it have to pass the field form to msg.php and reset the textarea.
I tried the code above but it didn't work
if i use
sm=getEl('msg_form').getUpdateManager();
the form disappear, load the msg.php page but don't pass the fields to the page
using
sm=getEl('sm').getUpdateManager();
sometime it load the page but didn't reset form
(i'm using .33beta3)
A live demo:
http://impellicment.net/chat[/code]
index.htm
App = function(){
[...]
var rmsg = new function(){
this.render = function(el, response){
var obj = response.responseText; // JSON data
alert(obj)
}
}();
[...]
sMsg : function(){
sm=getEl('msg_form').getUpdateManager();
sm.setRenderer(rmsg);
sm.formUpdate("msg_form","msg.php",true);
},
[...]
send (#)
<form id="msg_form" name="msg_form">
<input type="hidden" name="act" value="add"/>
<textarea id="msg_in" name="txt"></textarea>
</form>
<div id="sm"></div>
msg.php:
<?
[...]
echo $_REQUEST['txt'];
?>
what i would?
when a user compile the textarea and click on link "send" it have to pass the field form to msg.php and reset the textarea.
I tried the code above but it didn't work
if i use
sm=getEl('msg_form').getUpdateManager();
the form disappear, load the msg.php page but don't pass the fields to the page
using
sm=getEl('sm').getUpdateManager();
sometime it load the page but didn't reset form
(i'm using .33beta3)
A live demo:
http://impellicment.net/chat[/code]