Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables with html and vb

Status
Not open for further replies.

dmh4ab

Programmer
Oct 2, 2002
53
US
I'm using a visual basic program to create an html file. Is there any way I can make html take a variable from visual basic into the name of form controls?

ex:
ts.WriteLine &quot;<td align = center><input type = text size = 8 name = tfcodename></td>&quot;

where tfcodename is a variable that holds what i need the textbox to be named.

Thanks in advance!
 
First of all, it is better to put '' or &quot;&quot; around your attributes, like this:
ts.WriteLine &quot;<td align='center'><input type='text' size='8' name='tfcodename'></td>&quot;

One reason is that if you have something like:
value = a value
it will only see:
value = a
putting the quotes allows it to have more than one word.

I know that in JavaScript you'd have to do something like this, but I'm not familiar with VB:
...'8' name='&quot;+tfcodename+&quot;'></td>&quot;;

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top