Java script help

J

Jane Here

I am trying to understand how Java script works. Can someone help me with
this hopefully straightforward example:

I want one page to display different text. I want to put the text into two
separate arrays.

Array 1:
---------
aContent[0]=Fruit salad
aContent[1]=Vegetable pack
....
aContent[21]=Meat trays.

Array 2:
----------
aType[0]=Apples
aType[1]=Carrots
....
aType[21]=Beef.

Note: For the purpose of this example, I want the arrays to be separate.

Now on the page I want these buttons:
----------------------------------------------
(F)irst (P)revious (N)ext (L)ast
and these outputs: Display_Contents Display_Type

Initial display show --------------------------------- Fruit
alad ---------- Apples

User clicks (N)ext.
Counter gets incremented by 1

So display now shows: ---------------------------- Vegetable pack --------
Carrots

How would I accomplish this in Java script?
(I'm using FP2003).
 
K

Kevin Spencer

You'll have to forgive me, as I seem to have trouble interfacing with
humans. You say you want to "display" text. HOW do you want to "display" it?
Perhaps a bit of background about your business requirements would be
helpful.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
J

Jane Here

An example:

To see our top twenty tips, click Next:
---------------------------------------------------------------------
Tip 5: When boiling eggs, add salt to the water.
Comment 5: Keep eggs cold until needed.
<First> <Prior> <Next> <Last>
---------------------------------------------------------------------


I'd like to fill an array with the tips, and then when the user clicks Next
it shows the next one. When she clicks Prior, it shows the prior one.

Also, I'm curious to know how to write code to do the above with two arrays
(so I can have two lines of text). How would you keep both arrays in synch.
Example: If we display the Tip 5 from the first array, I also want to
display the 5th Comment from the second array. For future flexibility, I
would prefer to have two arrays rather than all in one array.




Kevin Spencer said:
You'll have to forgive me, as I seem to have trouble interfacing with
humans. You say you want to "display" text. HOW do you want to "display" it?
Perhaps a bit of background about your business requirements would be
helpful.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

Jane Here said:
I am trying to understand how Java script works. Can someone help me with
this hopefully straightforward example:

I want one page to display different text. I want to put the text into two
separate arrays.

Array 1:
---------
aContent[0]=Fruit salad
aContent[1]=Vegetable pack
...
aContent[21]=Meat trays.

Array 2:
----------
aType[0]=Apples
aType[1]=Carrots
...
aType[21]=Beef.

Note: For the purpose of this example, I want the arrays to be separate.

Now on the page I want these buttons:
----------------------------------------------
(F)irst (P)revious (N)ext (L)ast
and these outputs: Display_Contents Display_Type

Initial display show --------------------------------- Fruit
alad ---------- Apples

User clicks (N)ext.
Counter gets incremented by 1

So display now shows: ---------------------------- Vegetable ack --------
Carrots

How would I accomplish this in Java script?
(I'm using FP2003).
 
K

Kevin Spencer

I told you I had trouble communicating with humans! When you say "display"
you are talking about UI (user interface). In HTML, any UI element is an
HTML element of some kind. Do you want to "display" the text in the page as
text, in text boxes in a form, or what? Can you describe in HTML-terms, what
you want the user to see?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

Jane Here said:
An example:

To see our top twenty tips, click Next:
---------------------------------------------------------------------
Tip 5: When boiling eggs, add salt to the water.
Comment 5: Keep eggs cold until needed.
<First> <Prior> <Next> <Last>
---------------------------------------------------------------------


I'd like to fill an array with the tips, and then when the user clicks Next
it shows the next one. When she clicks Prior, it shows the prior one.

Also, I'm curious to know how to write code to do the above with two arrays
(so I can have two lines of text). How would you keep both arrays in synch.
Example: If we display the Tip 5 from the first array, I also want to
display the 5th Comment from the second array. For future flexibility, I
would prefer to have two arrays rather than all in one array.




Kevin Spencer said:
You'll have to forgive me, as I seem to have trouble interfacing with
humans. You say you want to "display" text. HOW do you want to "display" it?
Perhaps a bit of background about your business requirements would be
helpful.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

Jane Here said:
I am trying to understand how Java script works. Can someone help me with
this hopefully straightforward example:

I want one page to display different text. I want to put the text into two
separate arrays.

Array 1:
---------
aContent[0]=Fruit salad
aContent[1]=Vegetable pack
...
aContent[21]=Meat trays.

Array 2:
----------
aType[0]=Apples
aType[1]=Carrots
...
aType[21]=Beef.

Note: For the purpose of this example, I want the arrays to be separate.

Now on the page I want these buttons:
----------------------------------------------
(F)irst (P)revious (N)ext (L)ast
and these outputs: Display_Contents Display_Type

Initial display show --------------------------------- Fruit
alad ---------- Apples

User clicks (N)ext.
Counter gets incremented by 1

So display now shows: ---------------------------- Vegetable ack --------
Carrots

How would I accomplish this in Java script?
(I'm using FP2003).
 
J

Jane Here

We humans have trouble in saying what we mean<g>.

I guess I could have a table of 4 rows, 1 column. In FrontPage design I
would type it into a table like this:

| ---------------------------------------------------------------------|
| To see our top twenty tips, click Next:- |
| ---------------------------------------------------------------------|
| Tip 5: When boiling eggs, add salt to the water. |
| ---------------------------------------------------------------------|
| Comment 5: Keep eggs cold until needed. |
| ---------------------------------------------------------------------|
| <First> <Prior> <Next> <Last> |
| ---------------------------------------------------------------------|

Now the visitor clicks Next. The middle two rows should change to show the
next set of information (taken from an array).



Kevin Spencer said:
I told you I had trouble communicating with humans! When you say "display"
you are talking about UI (user interface). In HTML, any UI element is an
HTML element of some kind. Do you want to "display" the text in the page as
text, in text boxes in a form, or what? Can you describe in HTML-terms, what
you want the user to see?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

Jane Here said:
An example:

To see our top twenty tips, click Next:
---------------------------------------------------------------------
Tip 5: When boiling eggs, add salt to the water.
Comment 5: Keep eggs cold until needed.
<First> <Prior> <Next> <Last>
---------------------------------------------------------------------


I'd like to fill an array with the tips, and then when the user clicks Next
it shows the next one. When she clicks Prior, it shows the prior one.

Also, I'm curious to know how to write code to do the above with two arrays
(so I can have two lines of text). How would you keep both arrays in synch.
Example: If we display the Tip 5 from the first array, I also want to
display the 5th Comment from the second array. For future flexibility, I
would prefer to have two arrays rather than all in one array.




Kevin Spencer said:
You'll have to forgive me, as I seem to have trouble interfacing with
humans. You say you want to "display" text. HOW do you want to
"display"
it?
Perhaps a bit of background about your business requirements would be
helpful.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

I am trying to understand how Java script works. Can someone help me with
this hopefully straightforward example:

I want one page to display different text. I want to put the text
into
two
separate arrays.

Array 1:
---------
aContent[0]=Fruit salad
aContent[1]=Vegetable pack
...
aContent[21]=Meat trays.

Array 2:
----------
aType[0]=Apples
aType[1]=Carrots
...
aType[21]=Beef.

Note: For the purpose of this example, I want the arrays to be separate.

Now on the page I want these buttons:
----------------------------------------------
(F)irst (P)revious (N)ext (L)ast
and these outputs: Display_Contents Display_Type

Initial display show --------------------------------- Fruit
alad ---------- Apples

User clicks (N)ext.
Counter gets incremented by 1

So display now shows: ---------------------------- Vegetable
ack --------
Carrots

How would I accomplish this in Java script?
(I'm using FP2003).
 

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

Top