Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > ASP > ASP Forum > ทำไมผมใช้จาวาสริคปในการดักว่าถ้าไมกรอกก็จะไปไม่ได้ แต่ของผมมันกลับไปอ่ะ



 

ทำไมผมใช้จาวาสริคปในการดักว่าถ้าไมกรอกก็จะไปไม่ได้ แต่ของผมมันกลับไปอ่ะ

 



Topic : 072112



โพสกระทู้ ( 297 )
บทความ ( 0 )



สถานะออฟไลน์




ผมใช้จาวาสริคปในการดักช่องว่างแต่มันไม่ติดอ่ะ
ทำไมอ่ะครับ

Code (ASP)
<%
Response.Charset="TIS-620"
%>
<%
if Session("user")="" then
	Response.Redirect("../login.asp")
end if
%>
<!--#include file="userheader.asp"-->
<!--#include file="usermenu.asp"-->

<td class="f2">

<script language="javascript">
Function init()
{
	if (document.innew.txttile.value == "")
	{
		alert("กรุณาใส่หัวข้อข่าวด้วย");
		document.innew.txttile.focus();
		return false;
	}
	if (document.innew.txtdetail.value == "")
	{
		alert("กรุณาใส่รายละเอียดด้วยด้วย");
		document.innew.txtdetail.focus();
		return false;
	}
	if (document.innew.txttype.value == "")
	{
		alert("กรุณาใส่ส่วนงานด้วย");
		document.innew.txttype.focus();
		return false;
	}
	
	document.innew.sumbit();
	
}
</script>

<form action="insertnews.asp"  method="post" name="innew" onsubmit="return init()" enctype="multipart/form-data" >
<table width="80%" border="1" style="width:50%">
	<th colspan="2" align="center"> เพิ่มข่าวใหม่</th>
    <tr>
    	<td valign="top">หัวข้อข่าว</td>
        <td><input name="txttitle" type="text" size="80" /> </td>
    </tr>
    <tr>
    	<td valign="top">รายละเอียดข่าว</td>
        <td><textarea name="txtdetail" cols="80" rows="5"></textarea></td>
    </tr>
     <tr>
    	<td valign="top">ส่วนประกาศ</td>
        <td><select name="txtcall">  
       	   <option value="ข่าวประชาสัมพันธ์" selected="selected">ข่าวประชาสัมพันธ์</option>
          <option value="ข่าวประกาศ">ข่าวประกาศ</option>
          <option value="ข่าวกิจกรรม">ข่าวกิจกรรม</option>
          <option value="ข่าวการศึกษาก่อนปริญญา">ข่าวการศึกษาก่อนปริญญา</option>
          <option value="ข่าวการศึกษาหลังปริญญา">ข่าวการศึกษาหลังปริญญา</option>
        </select></td>
    </tr>
    <tr>
    	<td valign="top">หมายเหตุ</td>
        <td><input name="txtetc" type="text" size="80" /> </td>
    </tr>
    <tr>
    	<td valign="top">ส่วนงาน</td>
        <td><select name="txttype">  
          <option value="" selected="selected">กรุณาเลือก</option>
          <%
		  dim sqltype,rectype
		  sqltype="select * from unit "
		  set rectype=Server.CreateObject("ADODB.Recordset")
		  rectype.open sqltype,con
		  while not rectype.EOF
		  %>
          <option value="<%=rectype.fields("unitid").value%>" ><%=rectype.fields("unitname").value%></option>
          <%
		  rectype.movenext
		  wend
		  rectype.close()
		  set rectype=nothing
		  %>
        </select> </td>
    </tr>
    <tr>
    	<td valign="top">เอกสารแนบ</td>
        <td><input name="file1"type="file" size="80" /> </td>
    </tr>
     <tr>
    	<td colspan="2" align="center">
        <input name="submit" type="submit" value="บันทึก" />
        <input name="Reset" type="reset" value="ยกเลิก" />
        </td>
    </tr>
</table>
</form>
</td>
</tr>
</table>

<!--#include file="footer.asp" -->


ขอถามอีกอย่างหนึ่งนะครับ
เวลาจะอัพขึ้นโฮส เครื่อง Server จะต้องติดตั้ง ASPSmartUpload ด้วยรึเปล่าครับ



Tag : ASP, MySQL, HTML/CSS, JavaScript









ประวัติการแก้ไข
2012-01-17 11:46:52
2012-01-17 11:47:33
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-01-17 11:26:42 By : Clamore View : 1449 Reply : 3
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Go to : JavaScript HTML Check Input TextBox/Text Field

ลองไล่ดูครับ

Quote:
เวลาจะอัพขึ้นโฮส เครื่อง Server จะต้องติดตั้ง ASPSmartUpload ด้วยรึเปล่าครับ


ใช่ครับ จะต้องแจ้งให้ Server ติดตั้งให้ครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-17 13:20:46 By : webmaster
 


 

No. 2



โพสกระทู้ ( 297 )
บทความ ( 0 )



สถานะออฟไลน์


อันนี้ขอบคุณมากครับ
มีอีกปัญหาหนึ่งอ่ะครับ
คือถ้าล็อกอินแต่ใส่ username หรือ password ผิดให้มันแจ้งเตือนนี้ต้องทำยังไงอ่ะครับ
ใช้โค้ดนี้นะครับ
Code (ASP)
<!--#include file="header.asp"-->

<!--#include file="menu.asp"-->
<script language="javascript">
function fncSubmit()
{
	if(document.loginform.username.value == "")
	{
		alert('กรุณากรอก Username');
		document.loginform.username.focus();
		return false;
	}	
	if(document.loginform.password.value == "")
	{
		alert('กรุณากรอก Password');
		document.loginform.password.focus();		
		return false;
	}
	
	document.loginform.submit();
}
</script>
<td class="f2">



<div>
<form name="loginform" method="post" action="" onsubmit="javascript:return fncSubmit();">
<!--<input type="hidden" name="action" value="submit"/> -->
<p>
<table class="logg" border="0" cellspacing="1" cellpadding="3" width="400" align="center">
<tr align="center">
	<td colspan="2"  align="center" class="logg1" height="25px">Welcome to Administrator  
		</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
            
	<td class="tabright"><label for="login">Username :</label></td>
	<td><input type="text" name="username" id="username"  size="20" maxlength="20"/></td>
</tr>
<tr>
	<td class="tabright"><label for="password">Password :</label></td>
              <td><input name="password" type="password" class="input" id="password"  size="20" maxlength="20"/></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr >
	<td colspan=2  align="center">
		<input type="submit" value="ตกลง"/> <input type="reset" value="ยกเลิก"/>
	</td>
</tr>
</table>
</form>
    </div>
</td>
</tr>
</table>

<%
'Function login(byref username,byref password)
dim con,sql,rec
set con= Server.CreateObject("ADODB.Connection")
con.open "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost;UID=root;pwd=admin;database=med;option=16384;"
sql= "Select * from officer where of_username='" & request.Form("username") & "' and of_password='" & request.Form("password") & "' "
set rec=con.execute(sql)
if not rec.EOF then
	Session("user")=rec.fields("of_username").value
%>
	<input name="user" type="hidden" value="<%=rec.fields("of_username")%>" />
    <input name="pass" type="hidden" value="<%=rec.fields("of_password")%>" />
    
<%
	response.Redirect("user/index.asp")
	'response.Write(sql)
end if
'end function
%>

<!--#include file="footer.asp"-->



แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-17 15:14:48 By : Clamore
 

 

No. 3

Guest


<%
'Function login(byref username,byref password)
dim con,sql,rec
set con= Server.CreateObject("ADODB.Connection")
con.open "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost;UID=root;pwd=admin;database=med;option=16384;"
sql= "Select * from officer where of_username='" & request.Form("username") & "' and of_password='" & request.Form("password") & "' "
set rec=con.execute(sql)
if not rec.EOF then
Session("user")=rec.fields("of_username").value
%>
<input name="user" type="hidden" value="<%=rec.fields("of_username")%>" />
<input name="pass" type="hidden" value="<%=rec.fields("of_password")%>" />

<%
response.Redirect("user/index.asp")
'response.Write(sql)
else
response.write("<script language='JavaScript'>")
response.write("alert('username or password ไม่ถูกต้อง');")
response.write("</script>")
end if
'end function
%>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-23 13:39:30 By : Thep
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ทำไมผมใช้จาวาสริคปในการดักว่าถ้าไมกรอกก็จะไปไม่ได้ แต่ของผมมันกลับไปอ่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่