scalar param
[freeside.git] / httemplate / edit / elements / edit.html
index 3eb75f8..2556874 100644 (file)
@@ -240,7 +240,7 @@ Example:
 
 % my $url = $opt{'post_url'} || popurl(1)."process/$table.html";
 
-% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform', 'errormessage' => 'Please only numeric characters ' } };
+% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform' } };
   <FORM NAME   = "edit_topform"
         METHOD = POST
         ACTION = "<% $url %>"
@@ -412,7 +412,8 @@ Example:
 %     ## set conditionname field values for validation.
 %     if ($field eq 'conditionname') { 
 %       my $validate_field = $field . $fieldnum . '.after_event.run_delay';
-%       $js_form_validate->{edit_topform}{$validate_field} = 'numeric';
+%       $js_form_validate->{edit_topform}->{validate_fields}{$validate_field} = 'digits: true';
+%       $js_form_validate->{edit_topform}->{error_message}{$validate_field} = 'Please only enter numbers here.';
 %     }
 %
 %     my @include = 
@@ -639,6 +640,15 @@ Example:
             return;
           }
 
+%         if ( exists( $f->{'js_spawn_test'} ) ) {
+            // XXX check a passed-in hook here and optionall return
+            if ( <% $f->{'js_spawn_test'} %> ) {
+              // then go ahead and spawn
+            } else {
+              return;
+            }
+%         }
+
           // change the label on the last entry & add a remove button
           var prev_label = document.getElementById('<% $field %>_label' + <%$field%>_fieldnum );
           prev_label.innerHTML = '<INPUT TYPE="button" VALUE="X" TITLE="Remove this <% lc($f->{'m2_label'}) %>" onClick="remove_<% $field %>(' + <%$field%>_fieldnum + ');" STYLE="color:#ff0000;font-weight:bold;padding-left:2px;padding-right:2px" >&nbsp;<% $f->{'m2_label'} || $field %>';