Hmm.

RA Jones wrote:
Bruce McKenzie wrote:
I agree you'd be better off without CGI::Ajax -- doing it yourself (with the help of jQuery or Prototype) is much easier and more fun, because you can see what you're doing.
Perhaps so, but the j/s produced by CGI::Ajax for this script fills a screen even without any line-breaks and formatting, and it would be eons before I could write anything like that. Needless to say I don't have the remotest idea what it's doing.

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. Come to think of it, there are a couple well thought-out jQuery validation plugins available, one of which uses Ajax.


If you set the perl sub to

sub validate_nhso{      return 'Fred' ;
}

what happens?

Predictably, and disappointingly:
Content-Type: text/html; charset=ISO-8859-1 Fred


Aargh. Well that's not one I can recall running into :-(

Bruce

v. 212-477-4288
http://www.2MinuteExplainer.com

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