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 1895
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 stuck here.
|
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...
|
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,
Somasundaram G
|
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...
| |
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>
|
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>
|
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)">
|
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;
|
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...
|
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...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |