I am having a bit of a problem getting my OnComplete function to triger when submitting a form etc.
I am using classic ASP (i know, but I have no choice for this one - client request). Basically I have a form and on submitting it, it calls another .asp page. which will do some processing and when complete send back a message to inform the user if their submission was fine or not. While the form is submitting it displays a "loading" image.
The problem is that even when the response comes back but the loading image stays, so i think that the AJAX call isnt recieving a suitable "response" from the asp page - but I may be mistaken!
The code I have for the form is below:
- <div id="member">
- <h2>REGISTER FOR INFORMATION<h2>
- <div id="memberForm_AJAX_Wrapper">
- <div id="memberForm_AJAX_Response"></div>
- </div>
- <form action="registerUser.asp" method="POST" name="register_information" id="register_information">
- <label>Name:</label>
- <input type="text" name="name" class="txtBox" />
- <label>E-mail Address:</label>
- <input type="text" name="emailAdd" class="txtBox" />
- <label>Mobile No:</label>
- <input type="text" name="mobileNo" class="txtBox2" />
- <input type="submit" name="go" value="Go" class="go" />
- <br class="spacer" />
- </form>
- </div>
- <script type="text/javascript" language="javascript" >
- window.addEvent('domready', function() {
- $('register_information').addEvent('submit', function(e) {
- /**
- * Prevent the submit event
- */
- new Event(e).stop();
- /**
- * This empties the log and shows the spinning indicator
- */
- var log = $('memberForm_AJAX_Response').empty().addClass('memberForm_AJAX_Load');
- /**
- * send takes care of encoding and returns the Ajax instance.
- * onComplete removes the spinner from the log.
- */
- this.send({
- update: log,
- onComplete: function() {
- log.removeClass('memberForm_AJAX_Load');
- }
- });
- });
- });
- </script>
The asp page at the moment only contains a simple response.write -- until i can get this working.
- Response.Write("Mail Sent!")
I'm not that familiar with AJAX and Mootools, so far I have only been able to tweek examples given etc, so any help would be brilliant!


