<div dir="ltr">I&#39;m struggling with a form that has validation (an effort to make my forms right and proper). One of the fields, &#39;destination&#39;, is used to create the Target page. This field has validation, making sure it isn&#39;t too short or too long and doesn&#39;t include funky characters. The validation works; the creating of the page works. However, if an invalid character causes the validation to fail, the page displays the &#39;destination&#39; field as blank instead of the value typed in.<br>
<br>For example, I type in &#39;destination&#39;: San Diego/2008. The slash is invalid and the validation mark-up catches it and re-displays the form. The &#39;destination&#39; field is now blank. This doesn&#39;t happen with my other fields that have validation. They come back with the failed value (which is what I want and expect).<br>
<br>Note: I&#39;ve updated to the latest Fox.<br><br>The form mark-up--<br><br>(:foxmessages hrtravel list=nocheck:)<br>(:fox hrtravel put=top target=&#39;{$$destination}&#39; ptvupdate=1 template=TravelTemplate#display redirect=1 :)<br>
(:input defaults source={$EditSource} :)<br>(:input hidden foxnotify HR:)<br>(:foxcheck name=destination regex=&#39;^[a-zA-Z0-9_-\s]{3,40}+$&#39; msg=&quot;Only alphanumeric (at least 3 characters long but less than 40 characters), underscores, spaces or dashes allowed for destination names.&quot;:)<br>
<br>&#39;&#39;&#39;Travel Request Page Name:&#39;&#39;&#39; (:input text destination &quot;{$:destination}&quot; size=40:) %red%(:foxmessage hrtravel name=destination:)%%<br><br>&#39;&#39;&#39;Name(s) of Travelers&#39;&#39;&#39;<br>
(:foxcheck name=ptv_traveler1 msg=&quot;You must type in one Traveler name.&quot;:)<br>||(:input text name=$:traveler1 size=40:) %red%(:foxmessage hrtravel name=ptv_traveler1:)%%||<br>||(:input text name=$:traveler2 size=40:)||<br>
||(:input text name=$:traveler3 size=40:)||<br>||(:input text name=$:traveler4 size=40:)||<br>||(:input text name=$:traveler5 size=40:)||<br>||(:input text name=$:traveler6 size=40:)||<br>(:foxcheck name=ptv_noofattendee regex=&#39;[1-6]&#39; msg=&quot;The number of Travelers must be between 1 and 6.&quot;:)<br>
Number of Travelers: (:input text name=$:noofattendee size=3:) %red%(:foxmessage hrtravel name=ptv_noofattendee:)%%<br><br>&#39;&#39;&#39;Reason for Travel:&#39;&#39;&#39; (:input default $:travelreason Client :)<br>(:input radio $:travelreason Client :) Client visit<br>
(:input radio $:travelreason Conf :) Attending a conference<br>(:input radio $:travelreason Other :) Other<br><br>If a &#39;&#39;Client visit,&#39;&#39; which client(s)? (:input text name=$:clientvisit size=60:)<br><br>If attending a &#39;&#39;Conference,&#39;&#39; which conference? (:input text name=$:conference size=60:) <br>
<br>(:input default $:regcostper &quot;0&quot;:)<br>(:input default $:airfarecostper &quot;0&quot;:)<br>(:input default $:hotelcostper &quot;0&quot;:)<br>||Class=tabtable<br>||&#39;&#39;&#39;Item&#39;&#39;&#39; ||&#39;&#39;&#39;Amount&#39;&#39;&#39;||<br>
||Conference Registration Per Person ||$(:input text name=$:regcostper size=12:)||<br>||Airfare Per Person ||$(:input text name=$:airfarecostper size=12:) ||<br>||Hotel Per Person ||$(:input text name=$:hotelcostper size=12:) ||<br>
<br>(:input hidden name=$:conftotal &quot;{$$noofattendee} * {$$regcostper}&quot; :)<br>(:input hidden name=$:airtotal &quot;{$$noofattendee} * {$$airfarecostper}&quot; :)<br>(:input hidden name=$:hoteltotal &quot;{$$noofattendee} * {$$hotelcostper}&quot; :)<br>
(:input hidden name=$:totalcost &quot;{$$noofattendee}*({$$regcostper} + {$$airfarecostper} + {$$hotelcostper})&quot; :)<br><br><br>(:input submit post Enter:)<br>(:foxend hrtravel:)<br><br>-----------<br>I&#39;m not sure the template is wanted or required, but here it is--<br>
<br>!!!#display for HR Travel Expense Form<br>[@<br>[[#display]]<br>(:title {$$destination}:)<br>&gt;&gt;right messageheader&lt;&lt;&nbsp;&nbsp; <br>%green%[-created {$$(date:M j, &#39;y&nbsp; g a)}-]<br>&gt;&gt;frame messagetext&lt;&lt;<br>
<br>||border=0 rules=rows frame=hsides<br>||&#39;&#39;&#39;Travelers&#39;&#39;&#39;||{$$traveler1}||<br>|| ||{$$traveler2}||<br>|| ||{$$traveler3}||<br>|| ||{$$traveler4}||<br>|| ||{$$traveler5}||<br>|| ||{$$traveler6}||<br>
<br>&#39;&#39;&#39;Reason for Travel&#39;&#39;&#39; <br>{$$travelreason}<br><br>&#39;&#39;&#39;Clients Visited&#39;&#39;&#39; <br>{$$clientvisit}<br><br>&#39;&#39;&#39;Conference Name&#39;&#39;&#39;<br>{$$conference}<br><br>
!!!Cost<br>||class=tabtable<br>||Item || Cost Per || Travelers || Totals||<br>||Conference Total || ${(numfmt {$$regcostper} 2 &#39;.&#39; &#39;,&#39;)}|| {$$noofattendee}|| ${(numfmt (calc &#39;{$$conftotal}&#39;) 2 &#39;.&#39; &#39;,&#39;)}||<br>
||Airfare Total || ${(numfmt {$$airfarecostper} 2 &#39;.&#39; &#39;,&#39;)}|| {$$noofattendee}|| ${(numfmt (calc &#39;{$$airtotal}&#39;) 2 &#39;.&#39; &#39;,&#39;)}||<br>||Hotel Total || ${(numfmt {$$hotelcostper} 2 &#39;.&#39; &#39;,&#39;)}|| {$$noofattendee}|| ${(numfmt (calc &#39;{$$hoteltotal}&#39;) 2 &#39;.&#39; &#39;,&#39;)}||<br>
||Total || || || ${(numfmt (calc &#39;{$$totalcost}&#39;) 2 &#39;.&#39; &#39;,&#39;)}||<br><br>&gt;&gt;&lt;&lt;<br><br>-----<br>[[TravelRequest]]<br><br>[[#displayend]]<br>@]<br><br><br><br><br></div>