Validate user input
Keywords: Validate Validating user input
Question:
I am using the HTML Dialog Extender, to create a dialog. However I am interested in validating user input, without having to Redisplay the html file is the user doesn't fill in a required field. If I redisplay the dialog, all of the input fields are empty. This causes the user to have to refill all the required fields again.I saw an article on the tech support database that reference using FrontPage To help do this....
---clip--- 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. ---clip---
Answer:
Okay heres the deal. Apparently there is server-side form field validation and client-side form field validation.Server side validation would be handled by an asp, perl or some other server-side (on the web server) CGI script. (Not really want you need when using HTML Dialogs).
Client side validation would be handled by some type of script (Maybe Java script, VB script), not exactly sure... Here is a link to some info on 'Field validation' in Internet Explorer.
http://support.microsoft.com/support/kb/articles/Q216/4/35.ASP http://javascript.internet.com/forms/validation.html http://tech.irt.org/articles/js049/ http://msdn.microsoft.com/library/periodic/period99/validation.htm http://msdn.microsoft.com/library/techart/pdc_userinput.htm#pdc_userinputwalkYou will need to findout if FrontPage can create a client side script to validate the form fields......Look at the FrontPage help file to see if you can find anything out about client side 'field validation'....
I will continue to see if I can find anything out.....
This is going to require some extended knowledge of client side form field validation.......
User reply:
I think I found a solution. I used VBScript in my HTML code. I am going to try to understand what is going on with the code, I took little pieces from many different sources. Here is the code I copied/put together. Run the file in IE (I don't think VBScript works in Netscape with out a plug-in).HTML code, to valid user input, using VBscript.
<HTML> <head> <title></title> </head> <H2>Input Checker</H2> <P><FORM METHOD=POST Name=FileGen> <P>Text field:<input type="text" name="myText" size="20" tabindex="1"> <P> <INPUT TYPE="submit" NAME="enter" VALUE="Enter"> <input type=reset name=Clear value="Clear Form"> <SCRIPT LANGUAGE="VBScript"> <!-- Function FileGen_OnSubmit If FileGen.myText.value = "" Then FileGen_OnSubmit = False MsgBox "Please Enter Some text", 0, "FileGen" FileGen.myText.Focus Else FileGen_OnSubmit = True End If End Function --> </SCRIPT> </FORM> </HTML>WinBatch script....AddExtender("WWHTM34I.DLL") hBrowseSetPos(250, 250, 650, 650) path=FileLocate("sample.htm") hBrowse(2,path,2) Text=hGetVarValue("mytext"," ") hBrowse(0,path,0) Message("User input", text)Exit
Article ID: W14534Filename: Validate user input.txt