Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   a variable inHTML? (http://www.velocityreviews.com/forums/t392174-a-variable-inhtml.html)

Bob 02-14-2007 04:52 PM

a variable inHTML?
 
Can I have a variable in plain HTML?

pseudo such as:

<variable color="White">

<form...>
<input type=text value=color>
</form>

and have the word White as the value that appears in the textfield
on the browser's page. If that can't be done purely in HTML, how
best to work around? Thanks.

My intended purpose is to declare variables at the top of the code,
where easily visible and available to change, and have the effects
work later on throughout the working code.


Toby A Inkster 02-14-2007 04:57 PM

Re: a variable inHTML?
 
Bob wrote:

> Can I have a variable in plain HTML?


No.

> If that can't be done purely in HTML, how best to work around?


Server-side scripting. (e.g. PHP.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

Andy Dingley 02-14-2007 05:09 PM

Re: a variable inHTML?
 
On 14 Feb, 16:52, Bob <jhg...@albo.net> wrote:
> Can I have a variable in plain HTML?


No.

> pseudo


Sort of (macro expansion through server-side scripting), but it's a
rare occasion when that's of real practical use.

> <variable color="White">


What's your _real_ purpose for doing this? If it's to have some sort
of indirection between context and presentation, then CSS and the HTML
class attribute already does pretty much all you could want.

Otherwise tell us what you need to achieve (rather than how you've
already decided it ought to be implemented) and maybe we can give a
better idea.



All times are GMT. The time now is 04:04 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.