Re: Auto submission of form after the page has been loaded
Re: Auto submission of form after the page has been loaded
- Subject: Re: Auto submission of form after the page has been loaded
- From: LD <email@hidden>
- Date: Thu, 15 Sep 2005 22:53:16 +1000
Hi there,
On 15/09/2005, at 1:35 PM, Tanmoy Roy wrote:
I have pecuiliar requirement where for a particular validation to be
done we have to auto-submit a form in page after the page has been
loaded.
What sort of information are you retrieving?
I tried by giving the form submission in the BODY's onLoad
event but then went into an infinite loop of submitting the form.
Yep, that's programmed behaviour :-)
What you might need to look into is using JavaScript's XMLHttpRequest
or something.
See:
- http://developer.apple.com/internet/webcontent/xmlhttpreq.html
- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/
xmlsdk/html/xmobjxmlhttprequest.asp
var aRequest;
var isIE = false; // global flag
function sendRemoteXMLRequest(url) {
aRequest = false;
// branch for native XMLHttpRequest object
if(window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch(e) {
req = false;
}
// branch for IE/Windows ActiveX version
} else if(window.ActiveXObject) {
isIE = true;
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
req = false;
}
}
}
if (req) {
req.onreadystatechange = remoteResponseHandler;
req.open("GET", url, true[, user, passwd]);
req.send("Some Text or XML");
}
}
function remoteResponseHandler() {
// only if req shows "loaded"
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
// do something positive
} else {
alert("There was a problem retrieving the XML data:\n" +
req.statusText);
}
}
}
with regards,
--
LD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden