The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Define text of <td> command as variable
faethon
post Jun 24 2014, 04:08 AM
Post #1





Group: Members
Posts: 3
Joined: 24-June 14
Member No.: 21,132



Hi,

I am new on the HTML area and I would like to have some help from experienced users.

I am building some html pages and I would like the cell content to change depending on other data in my html page.
For example if the previous cell content is the same as the next one I would like the text content (Text Area) to be something different.

I think I have figured out how to do the checking using Vbscript but I am not sure how to define the (Text Area) text to be what I want.

<td colspan="1" class="sub_title">Text Area</td>

Any help is greatly appreciated. smile.gif

Thank you
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 24 2014, 05:08 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,826
Joined: 10-August 06
Member No.: 7



You need some scripting language, HTML alone can't do that.

Server side languages (e.g. PHP, but there are many others too) is the most reliable.

On the client side (the user's browser) only javascript is widely supported. VBscript only works in IE browsers.

QUOTE
I would like the cell content to change depending on other data in my html page.

Do these changes depend on user interaction in any way, and if so how? That may decide wether a server- or client side script is the best solution.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
faethon
post Jun 24 2014, 06:21 AM
Post #3





Group: Members
Posts: 3
Joined: 24-June 14
Member No.: 21,132



QUOTE(Christian J @ Jun 24 2014, 05:08 AM) *


Do these changes depend on user interaction in any way, and if so how? That may decide wether a server- or client side script is the best solution.


The user interaction is minimal. The pages are created by a program that reads several files and then makes some html pages.
I am trying to customize the html output to be at the correct format.

Are there any JavaScript examples that do similar things to what I am after and maybe I could have a look at?

Thank you
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 24 2014, 07:18 AM
Post #4


.
********

Group: WDG Moderators
Posts: 8,826
Joined: 10-August 06
Member No.: 7



QUOTE(faethon @ Jun 24 2014, 01:21 PM) *

The user interaction is minimal. The pages are created by a program that reads several files and then makes some html pages.

Why not let that program do all the changes then? unsure.gif

QUOTE
Are there any JavaScript examples that do similar things to what I am after and maybe I could have a look at?

Read the content of one element, and print it inside another element? https://developer.mozilla.org/en-US/docs/We....getElementById lets you identify elements by their ID, and https://developer.mozilla.org/en-US/docs/We...ement.innerHTML lets you read or write to the specified element. But I'd use javascript only as a last resort.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
faethon
post Jun 24 2014, 07:31 AM
Post #5





Group: Members
Posts: 3
Joined: 24-June 14
Member No.: 21,132



Thank you Christian you have been very helpful.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th July 2021 - 12:34 AM