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 -
<%@ Language=VBScript%>
-
<%Option Explicit
-
If Request.Cookies("userid") = "" Then
-
Response.Redirect "login.asp"
-
Else
-
Dim R, page,vopenflg
-
Dim vlaunchby,i,vcount
-
Dim vtopid,vnoofreply
-
Dim vtopstatus
-
Dim vtopsub
-
Dim vemail
-
Dim vmsg
-
Dim errorMsg
-
Dim conn
-
Set conn = Server.Createobject("ADODB.Connection")
-
conn.Open "DSN=ORACLE; User ID = STARTER; Password = STARTER"
-
Set R = Server.CreateObject("ADODB.Recordset")
-
R.Open "Select top_id from topmaster order by top_id ", conn, adOpenStatic, adLockOptimistic, adCmdText
-
If R.Recordcount > 0 Then
-
R.Movelast
-
vtopid = R("top_id")
-
vtopid = CInt(vtopid) + 1
-
Else
-
vtopid = 1
-
End if
-
R.Close
-
vopenflg=Response.Write("N")
-
vnoofreply=Cint(vnoofreply)
-
vnoofreply=0
-
If Not IsEmpty(Request.Form("submit")) then
-
vtopstatus = Request.Form("vtopstatus")
-
vtopsub = Request.Form("vtopsub")
-
vopenflg=request.form("vopenflg")
-
vmsg = Request.Form("vmsg")
-
vtopsub = trim(vtopsub)
-
vopenflg=trim(vopenflg)
-
vnoofreply=trim(vnoofreply)
-
vmsg = trim(vmsg)
-
vtopstatus = trim(vtopstatus)
-
If len(errorMsg) = 0 Then
-
If len(vtopsub) = 0 Then
-
errorMsg = "Please Enter Topic Subject "
-
End If
-
End if
-
If len(errorMsg) = 0 Then
-
If len(vmsg) = 0 Then
-
errorMsg = "* Your must enter your message"
-
end if
-
if len(vmsg) > 500 Then
-
errorMsg = "** More than 500 characters...now limiting to 500 "
-
End If
-
End If
-
If len(errorMsg) = 0 Then
-
conn.Close
-
conn.Mode = adModeReadWrite
-
conn.Open
-
R.Open "Select * from topmaster", conn, adOpenStatic, adLockOptimistic, adCmdText
-
R.Addnew
-
R("top_id") = vtopid
-
R("top_sub") = vtopsub
-
R("topic_status") = vtopstatus
-
R("launch_by") = request.cookies("userid")
-
R("launch_dt") = Cdate(date())
-
R("open_flg")= request.form(vopenflg)
-
R("no_of_reply")=vnoofreply
-
R("msg") = vmsg
-
R.UPdate
-
R.Close
-
Response.Redirect "message.asp"
-
End If
-
END IF
-
-
End If
-
%>
-
<html>
-
<head>
-
<title>Voice Of Baraunians</title>
-
<!--#include file="front1.inc"-->
-
</head>
-
<body>
-
<div style="Position:Absolute; top:100; left:15; width:980; height:472; background-color:#B4DEFE">
-
<center>
-
<b><BR>
-
<h2>POST YOUR MESSAGE</h2>
-
</b>
-
</center>
-
<hr>
-
<p>
-
<form method="POST" action="newtopic.asp">
-
<%If len(errorMsg) > 0 Then
-
Response.Write "<b><p><font color='red'> " & errorMsg & "</font></p></b>"
-
End If
-
%>
-
<table width=820>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="right"><font face="arial" size=2><b>Topic Subject : </b></font></td>
-
<td align='left'><input type="text" style="width:90%" name="vtopsub" maxlength="120"></td>
-
</tr>
-
<tr><td></td><td> ( Please Post Message Within 500 Character )</td><td></td></tr>
-
<tr>
-
<td align="right"><font face="arial" size=2><b>Message : </b></font></td>
-
<td align='left'><Textarea name="vmsg" cols="50" rows="10"></textarea></td>
-
</tr>
-
</table>
-
</tr>
-
<tr>
-
<table align="center" >
-
<tr>
-
<td align="center"><input type="Submit" name="submit" value="Save">
-
<input type="reset" name="reset" value="Reset">
-
</td>
-
</tr>
-
</table>
-
</tr>
-
</table>
-
<script language = "javascript">
-
function goback()
-
{
-
window.location = "brvoice.asp"
-
}
-
</script>
-
</form>
-
</p>
-
</div>
-
</body>
-
</html>
-
2 1887
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.
can fixed the length of textarea like sigle line input maxlength="100"
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
by: TdarTdar |
last post by:
Hello,
what is the code to get the running applications "ApplicationId"
Thanks
Tdar
|
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,...
|
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" %>
<%@...
|
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"...
|
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...
|
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:...
|
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;...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |