itp
11-28-2006, 04:07 AM
I am trying to adapt an AJAX example from using a submit button to an onblur. My form looks like this
<form name="form2" action="/mycgilibp/AJAX43.pgm"
method="post" target="_blank" onSubmit="submitForm(this);return false;">
My onblur looks like this. It works, but throws up a new page instead of populating the specified textarea .
value1 <INPUT TYPE="text"
value="Tabbing out of this text box should trigger a submit and display values below -NOT open a new page! "
NAME="value1" size="100"
maxlength="100"
onBlur= "document.form2.submit()">
<script type="text/javascript">
function submitForm(theform) {
var status = AjaxRequest.submit(theform,
//alert("hello");
{
'onSuccess':function(req){ document.forms['form2'].submitResults.value = req.responseText; }
}
);
return status;
}</script>
See live example here. It should make question more clear.
http://tinyurl.com/u3am7
<form name="form2" action="/mycgilibp/AJAX43.pgm"
method="post" target="_blank" onSubmit="submitForm(this);return false;">
My onblur looks like this. It works, but throws up a new page instead of populating the specified textarea .
value1 <INPUT TYPE="text"
value="Tabbing out of this text box should trigger a submit and display values below -NOT open a new page! "
NAME="value1" size="100"
maxlength="100"
onBlur= "document.form2.submit()">
<script type="text/javascript">
function submitForm(theform) {
var status = AjaxRequest.submit(theform,
//alert("hello");
{
'onSuccess':function(req){ document.forms['form2'].submitResults.value = req.responseText; }
}
);
return status;
}</script>
See live example here. It should make question more clear.
http://tinyurl.com/u3am7