chiark / gitweb /
Much tidying; preserve query type etc. in query_commod
[ypp-sc-tools.db-live.git] / yarrg / web / qtextstring
index 400716f119556e6bc0c893c82b5314ba6ac6206c..45f2e32a75c53f9b404cc93db52c858d84d8b99b 100644 (file)
@@ -29,7 +29,9 @@
  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>
 $thingstring
 $qa => $m->caller_args(1)->{'qa'}
 </%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;
@@ -86,7 +90,7 @@ window.onload= ts_Needed;
 <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">&nbsp;</div><br>