473,568 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can retrive the input text

idsanjeev
241 New Member
hello
how can retrive the input text after submit button pressed and report a error message. i wants to post topic and if any error message is occured then retrive the inputed text but it forget its
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript%> 
  2. <%Option Explicit 
  3. If Request.Cookies("userid") = "" Then 
  4.   Response.Redirect "login.asp" 
  5. Else 
  6. Dim R, page,vopenflg 
  7. Dim vlaunchby,i,vcount 
  8. Dim vtopid,vnoofreply 
  9. Dim vtopstatus 
  10. Dim vtopsub 
  11. Dim vemail 
  12. Dim vmsg 
  13. Dim errorMsg 
  14. Dim conn 
  15. Set conn = Server.Createobject("ADODB.Connection") 
  16. conn.Open "DSN=ORACLE; User ID = STARTER; Password = STARTER" 
  17. Set R = Server.CreateObject("ADODB.Recordset") 
  18.   R.Open "Select top_id from topmaster  order by top_id ", conn, adOpenStatic, adLockOptimistic, adCmdText 
  19.     If R.Recordcount > 0 Then 
  20.     R.Movelast 
  21.     vtopid = R("top_id") 
  22.     vtopid = CInt(vtopid) + 1 
  23.   Else 
  24.     vtopid = 1 
  25.   End if 
  26.    R.Close 
  27.    vopenflg=Response.Write("N") 
  28.    vnoofreply=Cint(vnoofreply) 
  29.    vnoofreply=0 
  30.  If Not IsEmpty(Request.Form("submit")) then 
  31.    vtopstatus = Request.Form("vtopstatus") 
  32.    vtopsub = Request.Form("vtopsub") 
  33.    vopenflg=request.form("vopenflg") 
  34.    vmsg = Request.Form("vmsg") 
  35.    vtopsub = trim(vtopsub) 
  36.    vopenflg=trim(vopenflg) 
  37.    vnoofreply=trim(vnoofreply) 
  38.    vmsg = trim(vmsg) 
  39.    vtopstatus = trim(vtopstatus) 
  40.  If len(errorMsg) = 0 Then 
  41.     If len(vtopsub) = 0 Then 
  42.       errorMsg = "Please Enter Topic Subject " 
  43.     End If 
  44.   End if 
  45.    If len(errorMsg) = 0 Then 
  46.      If len(vmsg) = 0 Then 
  47.        errorMsg = "* Your must enter your message" 
  48.     end if  
  49.      if len(vmsg) > 500 Then 
  50.        errorMsg = "**  More than 500 characters...now limiting to 500  " 
  51.      End If 
  52.    End If 
  53.   If len(errorMsg) = 0 Then 
  54.     conn.Close 
  55.     conn.Mode = adModeReadWrite 
  56.     conn.Open 
  57.     R.Open "Select * from topmaster", conn, adOpenStatic, adLockOptimistic, adCmdText 
  58.     R.Addnew 
  59.    R("top_id") = vtopid 
  60.     R("top_sub") = vtopsub 
  61.     R("topic_status") = vtopstatus 
  62.     R("launch_by") = request.cookies("userid") 
  63.     R("launch_dt") = Cdate(date()) 
  64.    R("open_flg")= request.form(vopenflg) 
  65.    R("no_of_reply")=vnoofreply 
  66.     R("msg") = vmsg 
  67.     R.UPdate 
  68.     R.Close 
  69.    Response.Redirect "message.asp" 
  70.   End If 
  71.   END IF 
  72.  
  73. End If 
  74. %> 
  75. <html> 
  76. <head> 
  77. <title>Voice Of Baraunians</title> 
  78. <!--#include file="front1.inc"--> 
  79. </head> 
  80. <body> 
  81. <div style="Position:Absolute; top:100; left:15; width:980; height:472; background-color:#B4DEFE"> 
  82.   <center> 
  83.     <b><BR> 
  84.       <h2>POST YOUR MESSAGE</h2> 
  85.     </b> 
  86.   </center> 
  87.   <hr> 
  88.   <p> 
  89.   <form method="POST" action="newtopic.asp"> 
  90.     <%If len(errorMsg) > 0 Then 
  91.        Response.Write "<b><p><font  color='red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & errorMsg & "</font></p></b>" 
  92.     End If 
  93.      %> 
  94.     <table width=820> 
  95.       <tr> 
  96.        <table align="center"> 
  97.          <tr> 
  98.           <td align="right"><font face="arial" size=2><b>Topic Subject : </b></font></td> 
  99.           <td align='left'><input type="text" style="width:90%" name="vtopsub" maxlength="120"></td> 
  100.        </tr> 
  101.    <tr><td></td><td> ( Please Post Message Within 500 Character )</td><td></td></tr> 
  102.    <tr> 
  103.    <td align="right"><font face="arial" size=2><b>Message : </b></font></td> 
  104.     <td align='left'><Textarea name="vmsg" cols="50" rows="10"></textarea></td> 
  105.    </tr> 
  106.   </table> 
  107.       </tr> 
  108.       <tr> 
  109.         <table align="center" > 
  110.           <tr> 
  111.             <td align="center"><input type="Submit" name="submit" value="Save"> 
  112.                                <input type="reset" name="reset" value="Reset"> 
  113.             </td> 
  114.          </tr> 
  115.        </table> 
  116.       </tr> 
  117.      </table> 
  118.      <script language = "javascript"> 
  119.          function goback() 
  120.            { 
  121.              window.location = "brvoice.asp" 
  122.            } 
  123.       </script> 
  124.     </form> 
  125.    </p> 
  126.   </div> 
  127.  </body> 
  128. </html> 
  129.  
Nov 27 '07 #1
2 1895
mcpete
2 New Member
I assume you mean the vmsg field?

If so, once you have sent the page, at the top of the next page, add:

<%

vmsg = request("vmsg")

%>

Hope this helped,

Pete.
Nov 28 '07 #2
idsanjeev
241 New Member
can fixed the length of textarea like sigle line input maxlength="100"
Nov 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4364
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm stuck here.
3
1402
by: epigram | last post by:
I've tried asking this question several times and have received many good answers, but ones that don't quite answer my question. This leads me to believe that I am trying to do something very awkward or I don't know how to pose the question correctly. Let me try again. I appreciate any input! :-) I have an asp.net web form with a TextBox...
1
1693
by: TdarTdar | last post by:
Hello, what is the code to get the running applications "ApplicationId" Thanks Tdar
2
1652
by: soma.gunasekaran | last post by:
Hi All , I've stored the Image file..... But i want to retriving the Image files from MSACCSS 2003 (JPEG,bmp,Gif and etc....) So Pls help me........ help me............... Thanking you, Somasundaram G
0
1530
by: varaprasad204 | last post by:
hai all..., i used to store my mp3 file into database by <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <%@ import Namespace="System.IO" %> <%@ import Namespace="System.Data.SqlClient" %> <%@ import Namespace="System.Drawing.Imaging" %> <%@ import Namespace="System.Drawing" %> <%@ import...
1
1663
idsanjeev
by: idsanjeev | last post by:
hello i wants to retrive data in textarea like input text but in textarea value is not work so what should be use to retrive textarea value after any error <input type="text" name="name" value="<%=name%>"> [/code>
1
2979
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for image upload in database: -----------Upload.jsp---------------- <html> <head> <title>Account Details </title>
5
1915
by: perhapscwk | last post by:
I want to use ajax, by selected the option box, retrieve data from a .xml file and fill in to the textbox. below is the html page <script src="selectcd.js"></script> <form> Select a CD: <select name="cds" onchange="showCD(this.value)">
1
1630
by: ganesh22 | last post by:
Hi, Here the below code is for dynamically creating textboxs, its creating fine but after user enters some values in textboxs how can i retrive that values? using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
0
7693
marktang
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
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...
0
3651
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
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
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.