sponsored by Three Rings.
- This Mason component handles `live' analysis of text string entries.
+ This Mason component handles analysis of text string entries, including
+ both the AJAX calls from web page javascript and the entry validation
+ and processing calls from other components.
</%doc>
<%args>
-$thingstring
$qa => $m->caller_args(1)->{'qa'}
+$dbh
+$thingstring
+$emsgstore
+$perresult
</%args>
-
-Enter route (islands, or archipelagoes, separated by |s or commas;
- abbreviations are OK):<br>
+<%perl>
+my $stringval= $qa->{$thingstring};
+$stringval='' if !defined $stringval;
+</%perl>
<&| script &>
-ts_uri= "check_<% $thingstring %>?format=json&type=text/xml"
+ts_uri= "qtextstringcheck?format=application/json&ctype=text/xml"
+ + "&what=<% $thingstring %>"
+ "&ocean=<% uri_escape($qa->{Ocean}) %>";
ts_timeout=false;
<input type="text" <% $m->content %>
id="<% $thingstring %>" name="<% $thingstring %>"
onchange="ts_Needed();" onkeyup="ts_Later();"
- value="<% $qa->{$thingstring} |h %>"
+ value="<% $stringval |h %>"
>
<br>
<div id="ts_results"> </div><br>
+
+<%perl>
+if (length $thingstring) {
+ my ($emsg,$canonstring,$results)= $m->comp('qtextstringcheck',
+ what => $thingstring,
+ ocean => $qa->{Ocean},
+ string => $stringval,
+ format => 'return'
+ );
+ $$emsgstore= $emsg;
+
+ foreach my $entry (@$results) {
+ $perresult->(@$entry);
+ }
+}
+</%perl>