Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Recheck HTML Input without Clearing Fields

Keywords: 	  field validation

Question:

I'm using the HTML Dialog Extender to present one screen where the user can select from a few checkmark boxes and enter text into a textbox. I'm making the text a required field and can sucessfully test it's contents via the WBT. My problem is that if the text box is blank I cannot figure out how to let the user enter info into the same HTML window without clearing all the checkmark boxes. Here's the guts of the WBT code I'm having trouble with, though for all I know I can handle this in the HTML.
:start
url=hBrowse(1,path,2)
if url=="" then exit

SendMsg=hGetVarValue("Message", "")
If SendMsg=="" then
Message("Title", "You must enter a message")
goto start
EndIf
...do stuff 

Answer:

Well... One horrible way and one nice way.

The only way to preserve the information is to write a new HTML file with the values defaulting to the previously set values. Not a pretty sight.

But wait. The HTML Dialogs use the MSIE 4.0 browser window. The MSIE4.0 browser has *all kinds* of field validation stuff built into the browser. With the right HTML your Winbatch code will not even have to verify parameters, I think the Browser FORM stuff won't let them hit the submit button until it is happy.

To really see this sort of stuff, you have to either wade thru the MS Documentation, or use either FrontPage Express or FrontPage to edit the html file. If you right click on the field and click around you should be able to find the parameter validation stuff.


Article ID:   W14133
Filename:   Recheck HTML input without clearing fields.txt