chiark / gitweb /
Revamp qtextstring arrangements
[ypp-sc-tools.db-live.git] / yarrg / web / qtextstring
index 400716f119556e6bc0c893c82b5314ba6ac6206c..82c29dcda728e030ef4587fca3dc0a086b9bce87 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>
+<%perl>
+my $stringval= $qa->{$thingstring};
+$stringval='' if !defined $stringval;
+</%perl>
 
 Enter route (islands, or archipelagoes, separated by |s or commas;
  abbreviations are OK):<br>
 
 <&| 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 +93,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>