Ajax Toolbox - using onchange event

I

itp

I have moved to Matt Kruse's Javascript Toolbox. It has some great
examples to get you going quickly!

Unfortunately all the examples are based on a form/submit model. I
would like to try using the onchange event ot submit a request. Has
anyone tried this and could maybe provide an example?

ref: http://www.ajaxtoolbox.com/about/
 
M

Matt Kruse

itp said:
I would like to try using the onchange event ot submit a request. Has
anyone tried this and could maybe provide an example?

What kind of example would you like?

Most of the examples aren't actually based on form submittal. They just use
form buttons to trigger code. You could trigger the same code via an
element's onchange event.
 
I

itp

Hi Matt:

I would like to reproduce this page using your toolbox.
ref: http://tinyurl.com/n4pp2

I realize that the submit button only triggers a script, however the
<form action=program_name is used to determine what program to run. I
cannot figure out how to do this using an onchange.

By the way your stuff is great!!!

itp
 
I

itp

OK. I am making progress. I can now trigger the form from an onblur
event, however my XMLHttpRequest is showing up in a new browser
instance.

code extract..
------------------------------------------------------------------------------------------------------------
<form name="form2" action="/mycgilibp/AJAX43.pgm"
method="post" target="_blank" onSubmit="submitForm(this);return
false;">

<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>

value1
<INPUT TYPE="text"
value="Tabbing out of this text box should trigger a submit and
display values below. "
NAME="value1" size="80"
maxlength="80"
target="_blank"
onBlur= "document.form2.submit()">
---------------------------------------------------------------------------------------------------------------------------------------

try it:
http://tinyurl.com/u3am7
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top