The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> real time interaction with html form
raymar1
post Jan 14 2016, 01:23 PM
Post #1





Group: Members
Posts: 1
Joined: 14-January 16
Member No.: 23,906



Hi there, I'm wondering if anyone can help me smile.gif

I have an image slideshow javascript which works fine. It goes through my folder which has images called image1.png, image2.png etc.

The line of code that traverses the images is:

QUOTE
dimages[i].src="image"+(i+1)+".png";


I'm interested in changing that "1" value to be a variable, so if I changed it to 2 it would show me every other image.

If I have an HTML form, such as below:

QUOTE
<select name="select" size="5">
<option value="select_one">1</option>
<option value="select_two">2</option>
<option value="select_three">3</option>
<option value="select_four">4</option>
<option value="select_five">5</option>
</select>


How would I go about changing the value that currently says i+1 to be i+whatever_value_is_selected_on_the_form

Many thanks

This post has been edited by raymar1: Jan 14 2016, 01:23 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jan 14 2016, 02:34 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Attached is a sample of what needs to be done. You really should change the option value to be the actual number instead of the 'select_one', etc ... values you currently use. If you really want to leave things as they are then you need to comment the 1 line in the function and un-comment the other line. If you have any questions just ask.
Attached File  temp.html ( 748bytes ) Number of downloads: 493
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: 19th March 2024 - 12:37 AM