473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how can retrive the input text

idsanjeev
241 100+
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 1887
mcpete
2
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 100+
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
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...
3
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...
1
by: TdarTdar | last post by:
Hello, what is the code to get the running applications "ApplicationId" Thanks Tdar
2
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,...
0
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" %> <%@...
1
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"...
1
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...
5
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:...
1
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;...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.