9 Replies - 1218 Views - Last Post: 18 March 2013 - 06:50 AM

#1 Alfred L  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 09-March 13

Validate Checking in HTML

Posted 11 March 2013 - 08:22 PM

Hello.. I have some problem here about validation checking..My program should pop up message "Submit Complete" but I don't know how ? :death:
Is This A Good Question/Topic? 1
  • +

Replies To: Validate Checking in HTML

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3525
  • View blog
  • Posts: 10,170
  • Joined: 08-June 10

Re: Validate Checking in HTML

Posted 11 March 2013 - 11:11 PM

well, primarily that depends on the Programming Language used.
Was This Post Helpful? 0
  • +
  • -

#3 Takk  Icon User is offline

  • D.I.C Head

Reputation: 40
  • View blog
  • Posts: 111
  • Joined: 08-March 13

Re: Validate Checking in HTML

Posted 11 March 2013 - 11:16 PM

We'll need some code or something here bud :)
Was This Post Helpful? 0
  • +
  • -

#4 Alfred L  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 09-March 13

Re: Validate Checking in HTML

Posted 12 March 2013 - 12:25 AM

Well this is the simple coding :
<%@language="javascript"%>
<html>
<head><title>Signup</title></head>
<script type="text/javascript">

	function validate()
	{
		var id = document.Add.id.value;
		var name = document.Add.name.value;
		var user_group = document.Add.user_group.value;
		var pass = document.Add.pass.value;
		var re_type = document.Add.re_type.value;
		
		if(id=="")
		{
			alert("Please Enter You ID");
			return false;
		}
		if(name=="")
		{
			alert("Please Enter You Name");
			return false;
		}
		if(user_group=="")
		{
			alert("Please Select You Categories");
			return false;
		}
		if(pass=="")
		{
			alert("Please Enter You Password");
			return false;
		}
		if(re_type=="")
		{
			alert("Please Re-Type You Password");
			return false;
		}
		if(pass != re_type)
		{
			alert("Please Check You Password and Confirm Password");
			return false;
		}
	}
</script>
<%
	if(Request.Form("submit")=="Save")
	{
		var DSN = " Provider = Microsoft.JET.OLEDB.4.0; Data Source = C:/Inetpub/wwwroot/demo/Data.mdb";
		var Conn = Server.CreateObject("ADODB.Connection");
		Conn.Open(DSN);
		
		var Id = Request.Form("id");
		var Name = Request.Form("name");
		var User = Request.Form("user_group");
		var User_pass = Request.Form("pass");
		var Re_pass = Request.Form("re_type");
		
				var sqlStmt = "INSERT INTO user_info";
					sqlStmt += "(ID, username, usergroup, userpassword, confirmpassword)";
					sqlStmt += "VALUES";
					sqlStmt += "(";
					sqlStmt += "'" + Id + "',";
					sqlStmt += "'" + Name + "',";
					sqlStmt += "'" + User + "',";
					sqlStmt += "'" + User_pass + "',";
					sqlStmt += "'" + Re_pass + "'";
					sqlStmt += ")";
					
				Conn.Execute(sqlStmt);
			Conn.Close();
			Response.write("You Already Signup"); 
				Response.Redirect("Login.asp");
	}
%>
<body>
	<form name="Add"action="Signup.asp" method="POST"onsubmit="return validate()">
		<table>
			<tr>
				<td>Name<td>:<td><input type="text"name="name">
			</tr>
			<tr>
				<td>ID<td>:<td><input type="text"name="id"maxlength="11">
			</tr>
			<tr>
				<td>User Categories<td>:<td><select name="user_group">
					<option> </option>
					<option value="STUDENT"selected>Student</option>
					<option value="STAFF">Staff</option>
				</select>
			</tr>
			<tr>
				<td>Password<td>:<td><input type="password"name="pass">
			</tr>
			<tr>
				<td> Confirm Password<td>:<td><input type="password"name="re_type">
			</tr>
		</table>
		<input type="submit"name="submit"value="Save"onclick="return confirm('Are you sure want to submit ?');">
	</form>
</body>
</html>

:beta1:
Was This Post Helpful? 0
  • +
  • -

#5 SBUSISO  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 11-March 13

Re: Validate Checking in HTML

Posted 12 March 2013 - 12:25 AM

just use Javascript to validate your code
Was This Post Helpful? 0
  • +
  • -

#6 Alfred L  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 09-March 13

Re: Validate Checking in HTML

Posted 12 March 2013 - 08:02 PM

View PostSBUSISO, on 12 March 2013 - 12:25 AM, said:

just use Javascript to validate your code


Do you have any example ?
Was This Post Helpful? 0
  • +
  • -

#7 eugenerudenko  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 47
  • Joined: 13-March 13

Re: Validate Checking in HTML

Posted 15 March 2013 - 06:12 AM

May be something like this line:

<a href="javascript:popcontact(\'pop-up.htm\')">Link Name</a>
Was This Post Helpful? 0
  • +
  • -

#8 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,986
  • Joined: 08-June 10

Re: Validate Checking in HTML

Posted 15 March 2013 - 06:41 AM

View Posteugenerudenko, on 15 March 2013 - 01:12 PM, said:

May be something like this line:

<a href="javascript:popcontact(\'pop-up.htm\')">Link Name</a>

Where is that "popcontact" function supposed to be coming from? That's not a part of any standard Javascript API I know about. And why are you escaping the single quotes?
Was This Post Helpful? 0
  • +
  • -

#9 eugenerudenko  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 47
  • Joined: 13-March 13

Re: Validate Checking in HTML

Posted 18 March 2013 - 05:34 AM

View PostAtli, on 15 March 2013 - 06:41 AM, said:

View Posteugenerudenko, on 15 March 2013 - 01:12 PM, said:

May be something like this line:

<a href="javascript:popcontact(\'pop-up.htm\')">Link Name</a>

Where is that "popcontact" function supposed to be coming from? That's not a part of any standard Javascript API I know about. And why are you escaping the single quotes?

here should go a link to the "Submit Complete" message
Was This Post Helpful? 0
  • +
  • -

#10 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,986
  • Joined: 08-June 10

Re: Validate Checking in HTML

Posted 18 March 2013 - 06:50 AM

That's not what I asked.

The code you posted is completely useless unless the popcontact function is defined somewhere. Where is it defined? What does it do? We can only infer from the name that it is supposed to create a popup for a contact page, but without the code for the function or whatever library provides it, the function call is pointless.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1