Bruce McKenzie wrote:

with the tiny (~15k) jQuery library loaded, all the javascript you would have to write would be something like this (assuming you use rm=runmode in CGIApp)

function validateNHSOwithAjax(myInput){
  $('#someHTMLContainer').load(
    'myWebApp.cgi',
  {
    rm : 'validate_nhso',
    itemToValidate : myInput
  });
}

This will neatly and reliably make the Ajax request and place the result from your runmode where you want it on the HTML page.

OK, I tried the following in the <head> section of my template:
<script type="text/javascript" src="/jquery.js"></script>
<script type="text/javascript">
<!--
function validate_nhsno(myInput) {
  $('#nhs_no').load(
    'check_nhsno.cgi',
  {
    rm : 'validate_nhsno',
    itemToValidate : myInput
  });
}
// -->
</script>

HTML form contains:
<p>NHS No: <input type="text" name="nhs_no" id="nhs_no" onblur="validate_nhsno('nhs_no'); return true;" />

Result: nothing! Is the above a correct interpretation of your example? It might even be working, but I cannot see anywhere for the result of the AJAX request to go.

***************************************************************************
This e-mail is confidential and privileged. If you are not the intended
recipient please accept our apologies; please do not disclose, copy or
distribute information in this e-mail or take any action in reliance on its
contents: to do so is strictly prohibited and may be unlawful. Please
inform us that this message has gone astray before deleting it. Thank you
for your co-operation.
***************************************************************************


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to