Let's say, user input on prompt is 1 so JavaScript will create one textfield.
We'll test Assess() if its working. Type "1" on textField and click "Assess" button.
No alert message appears.
Please help. Thanks in advance.

		<style type="text/css">
		<script type="text/javascript">
		var n = '\n';
		var inp;
			 inp = prompt("Number of inputs to assess." + n + n + "Maximum of 10.");//asks user how many input will the program assess
		}while (inp > 10 || inp <=0);
		document.write("<form name=\"myForm\" action=\"\"><font>");
		var txt1 = "<input type=\"text\" name=\"t>";
		var txt2 = "\"></input><br/><br/>";
		for (i=1;i<=inp;i++){
			document.write("TextField # " + i + " " + txt1 + i + txt2);//creates textfields depending upon the "inp" variable
		function Assess(){
			var g = document.myForm.t1.value;
			if (g==1){
				alert("Invalid input found at TextField # 1.");
		<input type="button" value="Assess" onClick="Assess()"/>
		</font></form><!--Closes form and font tag from javascript-->

problem solved by changing txt1 and txt2 to

var txt1 = "<input type='text' name='t";
		var txt2 = "'></input><br/><br/>";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.