|
 |
asp_databases thread: Passing variables from VB to an HTML form
Message #1 by srobinson@g... on Fri, 5 Oct 2001 13:42:26
|
|
Hi All,
Does anyone know how I can pass the value of a VB variable to an HTML form?
I believe it is something like - myform.mytext = variable
Can anyone help?
Cheers,
Simon.
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 8 Oct 2001 13:12:03 +1000
|
|
This is how to put the value of an ASP variable into a HTML form element.
You neglected to mention whether you were talking about server-side
VBScript, or client-side VBscript (and since this is an ASP list, I assumed
the former...apologies is this is of no use to you!)
<%
strTest = "This is some text"
%>
<form>
<input type="text" name="txt1" value="<%=strTest%>">
</form>
HTH
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <srobinson@g...>
Subject: [asp_databases] Passing variables from VB to an HTML form
: Does anyone know how I can pass the value of a VB variable to an HTML
form?
:
: I believe it is something like - myform.mytext = variable
:
: Can anyone help?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by David Cameron <dcameron@i...> on Mon, 8 Oct 2001 10:10:36 +1000
|
|
What 'thing' in VB do you want to pass in from? exe, dll etc.
regards
David Cameron
nOw.b2b
dcameron@i...
-----Original Message-----
From: srobinson@g... [mailto:srobinson@g...]
Sent: Friday, 5 October 2001 11:42 PM
To: ASP Databases
Subject: [asp_databases] Passing variables from VB to an HTML form
Hi All,
Does anyone know how I can pass the value of a VB variable to an HTML form?
I believe it is something like - myform.mytext = variable
Can anyone help?
Cheers,
Simon.
Message #4 by srobinson@g... on Tue, 9 Oct 2001 11:00:46
|
|
Hi All,
I have a variable 'jn' which gets its value form Recordset1.items
("Jobnumber1").Value in an Access 2000 database.
After performing a simple calculation on jn
I am passing jn to Jobnumber1 in an HTML form like so:-
<input type ="hidden" name="Jobnumber1" value="<%=jn%>">
The problem is that the value of jn is getting lost outside of the initial
VB function which is
Function GetJobNumber
Dim jn
jn = Recordset1.items("Jobnumber1").Value
jn = jn + 1
End Function
When the form is submitted back to the database, the value of jn is lost.
Can anyone help?
Cheers,
Simon.
Message #5 by "Tomm Matthis" <matthis@b...> on Tue, 9 Oct 2001 09:48:33 -0400
|
|
In you function JN is local to the procedure. Declare it outside of the
procedure so it has public scope.
-- Tomm
> -----Original Message-----
> From: srobinson@g... [mailto:srobinson@g...]
> Sent: Tuesday, October 09, 2001 11:01 AM
> To: ASP Databases
> Subject: [asp_databases] Passing variables from VB to an HTML form
>
>
> Hi All,
>
> I have a variable 'jn' which gets its value form Recordset1.items
> ("Jobnumber1").Value in an Access 2000 database.
>
> After performing a simple calculation on jn
>
> I am passing jn to Jobnumber1 in an HTML form like so:-
>
> <input type ="hidden" name="Jobnumber1" value="<%=jn%>">
>
> The problem is that the value of jn is getting lost outside of the initial
> VB function which is
>
> Function GetJobNumber
>
> Dim jn
>
> jn = Recordset1.items("Jobnumber1").Value
>
> jn = jn + 1
>
> End Function
>
> When the form is submitted back to the database, the value of jn is lost.
>
> Can anyone help?
>
> Cheers,
>
> Simon.
>
>
> $subst('Email.Unsub')
>
>
|
|
 |