Home Posts Topics Members FAQ
haridhasekar
8 New Member
hi ...
i wanna store in the backend sql server 2000, while validation its not at all stored... i have attached the codings ... pls check....
Expand|Select|Wrap|Line Numbers
- trial.asp
- <%@Language=VBScript%>
- <%
- dimrs
- SetCon=Server.CreateObject("ADODB.connection")
- con.CursorLocation=3
- con.ConnectionString="driver={sqlserver};server=yummy;uid=gal;pwd=gal;database=pubs"
- con.Open
- Setrs=Server.CreateObject("ADODB.Recordset")
- session("emp_no")=Request.Form("emp_no")
- session("emp_name")=Request.Form("emp_name")
- session("sal")=Request.Form("sal")
- subinsert()
- rs.Fields("empno")=session("emp_no")
- rs.Fields("empname")=session("emp_name")
- rs.Fields("sal")=session("sal")
- endsub
- flag=Request.QueryString("flag")
- ifflag="insert"then
- rs.Open"SELECT*FROMempdtl",con,2,3
- rs.AddNew
- insert()
- rs.Update
- endif
- session("msg")="Recordsupdatedsuccessfully."
- Response.Redirect"trialmain.asp"
- %>
and another asp file as:
Expand|Select|Wrap|Line Numbers
- trialmain.asp
- <%@Language=VBScript%>
- <scriptlanguage="javascript">
- functionformvalidation()
- {
- varempno=document.getElementById('emp_no');
- varempname=document.getElementById('emp_name');
- varsal=document.getElementById('sal');
- if(isNumeric(empno,"Pleaseenterthenumber")
- {
- if(isAlphabet(empname,"Pleaseenterthename")
- {
- isNumeric(sal,"Pleaseenterthesalary")
- {
- document.f1.action="trial.asp?flag=insert"
- document.f1.submit();
- returntrue;
- }
- }
- }
- returnfalse;
- }
- functionisNumeric(elem,helperMsg){
- varnumericExpression=/^[0-9]+$/;
- if(elem.value.match(numericExpression)){
- returntrue;
- }else{
- alert(helperMsg);
- elem.focus();
- returnfalse;
- }
- }
- functionisAlphabet(elem,helperMsg){
- varalphaExp=/^[a-zA-Z]+$/;
- if(elem.value.match(alphaExp)){
- returntrue;
- }else{
- alert(helperMsg);
- elem.focus();
- returnfalse;
- }
- }
- </script>
- <HTML>
- <HEAD>
- <METANAME="GENERATOR"Content="MicrosoftVisualStudio6.0">
- </HEAD>
- <BODY>
- <FORMmethod=postid=f1name=f1>
- <%
- SetCon=Server.CreateObject("ADODB.connection")
- con.CursorLocation=3
- con.ConnectionString="driver={sqlserver};server=yummy;uid=gal;pwd=gal;database=pubs"
- con.Open
- msg=session("msg")
- session("msg")=""
- emp_no=session("emp_no")
- emp_name=session("emp_name")
- sal=session("sal")
- %>
- <FORMmethod=postname=fo1id=fo1>
- <TABLEstyle="WIDTH:334px;HEIGHT:90px"cellSpacing=1cellPadding=1width=334
- border=0>
- <TR>
- <TD>EmployeeNo</TD>
- <TD><INPUTtype="text"id="emp_no"value=<%=emp_no%>></TD></TR>
- <TR>
- <TD>EmployeeName</TD>
- <TD><INPUTtype="text"id="emp_name"value=<%=emp_name%>></TD></TR>
- <TR>
- <TD>Salary</TD>
- <TD><INPUTtype="text"id="sal"value=<%=sal%>></TD></TR></TABLE>
- <P><inputname="Submit1"type="submit"value="submit"onclick="javascript:formvalidation()"></P></FORM>
- </form>
- </BODY>
- <%
- iflen(msg&"")>0then
- Response.Write"<scriptlanguage=javascript>"
- Response.Write"{alert('"&msg&"');}</script>"
- msg=""
- endif
- %>
- </HTML>
Mar 10 '10 #1
Subscribe Reply
jhardman 3,406 Recognized Expert Specialist
so what problem are you having?
Jared
Mar 11 '10 #2
reply
Sign in to post your reply or Sign up for a free account.
Similar topics
5 16233 Error during deployment by: Tony Wright |last post by: Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet... .NET Framework |
6 4727 Error Trapping In Access 2000 by: Peter Frost |last post by: Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance Microsoft Access / VBA |
7 4992 Error crystal websetup 9 install by: p |last post by: WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version,... ASP.NET |
2 19436
Custom Error Messages in Access by: hyperpau |last post by: Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's... Visual Basic 4 / 5 / 6 |
2897
Custom Error Messages by: hyperpau |last post by: Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's... Microsoft Access / VBA |
7778
What is ONU? by: marktang |last post by: ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main... General |
7687 Changing the language in Windows 10 by: Hystou |last post by: Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language... Windows Server |
1 7777 The easy way to turn off automatic updates for Windows 10/11 by: Hystou |last post by: Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For... Windows Server |
6413
AI Job Threat for Devs by: agi2029 |last post by: Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then... Career Advice |
5290 Couldnt get equations in html when convert word .docx file to html file in C#. by: conductexam |last post by: I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert... C# / C Sharp |
3731 Trying to create a lan-to-lan vpn between two differents networks by: TSSRALBI |last post by: Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in... Networking - Hardware / Configuration |
1 2203 transfer the data from one system to another through ip address by: 6302768590 |last post by: Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system C# / C Sharp |
1 1300
How to add payments to a PHP MySQL app. by: muto222 |last post by: How can i add a mobile payment intergratation into php mysql website. PHP |
1039
Comprehensive Guide to Website Development in Toronto: Expert Insights from BSMN Consultancy by: bsmnconsultancy |last post by: In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating... General |
By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.
To disable or enable advertisem*nts and analytics tracking please visit the page.