assigning values to form inputs

G

Guest

T.I.A. to whomever replys...

I'm new to ASP. I'm reading input from a flat-file (not a DB) using a
vbscript routine to display on an ASP form so that a user can update the
info, submitting the form back to update the file. When I tried the html
command:

document.myformname.myfieldname.value = myvarname

I get an object error msg. What is the correct ASP syntax for doing this?
 
N

Norman Yuan

Where that line of code did you put?

It is client end script and only runs in client browser. It has nothing to
do with ASP.NET server side code.
 
G

Guest

Please disregard my previous code example and let me rephrase my question as
I'm fairly new to internet/intranet programming. By the way, this is a
'classic ASP' question, not necessarily an ASP .NET question; if I'm in the
wrong newsgroup, please direct me to the right one.

In the sample-code below, what syntax would I use in VBscript on the
server-side to PROGRAMATICALLY set the default-value of the 'codeinput'
field to 'AA1'?

<html><body>
<form action="asptest3.asp" method="post" name="myform">
<!-- default value 'AA1' -->Enter 3-letter Code: <input type="text"
name="codeinput" value="AA1" size="3">
<br><br>
<center><input type="submit" value="<< Update >>"></center>
</form>
<%
dim codeinput

codeinput=Request.Form("codeinput")
If codeinput<>"" then
Response.Write("The code you entered was: " & codeinput)
End If
%>
</body></html>

Thanks again for your help...
 
K

Karl

microsoft.public.inetserver.asp.general

The only way to do it in ASP is to output the value in the tag

<%
dim someValue = "defaultValue
%>
<input type="submit" value="<%=somevalue%>">


Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top