Javascript Help

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
Mandro
Registered User
Posts: 1
Joined: 15 Mar 2011, 10:39

Javascript Help

Post by Mandro »

Hi guys!

I have a four step html form that i have coded but what i need to try and figure out is the following:

I have a basic unordered list menu at the top of the page:

<ul>
<li>STEP 1:</li>
<li>STEP 2:</li>
<li>STEP 3:</li>
<li>STEP 4:</li>
</ul>

and what i want to happen is when the user is on "Step 1" the list item should be a certain css class so that the user know they are now on step 1 of 4 and then as they move on through the form that particular css class moves through the unordered list.

Hope the above makes sense, please help!
-Prometheus-
Resident Drama Llama
Posts: 967
Joined: 05 Mar 2008, 02:00
Contact:

Re: Javascript Help

Post by -Prometheus- »

........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
........................................................................................................................................................................................................
Last edited by -Prometheus- on 04 Apr 2011, 04:25, edited 1 time in total.
BBLounge - Broadband and Technology forum
Please like our facebook page
DeathStrike
Registered User
Posts: 2663
Joined: 29 Jul 2004, 02:00
Location: hidden deep in the depths of the underworld is my home.
Contact:

Re: Javascript Help

Post by DeathStrike »

hmmm. need more info...

you will need to give each li an id

eg.

Code: Select all

<li id="li1">STEP 1:</li>
then you call it

Code: Select all

<script language="javascript">
function test(){
document.formname.li1.class = "classname";
}
</script>
very roughly done.
Spoiler: (show)
Image
SIG by HMAN 8)
Member of The Pride Of Darkness
DeathStrike on Twitter
About me
Spoiler: (show)
Asus P5KPL-CM motherboard, 4 GIG RAM, Q6600 @ 2.88GHz (Thanks Anthro), GeForce 8600GT, Samsung 2333 23" + CRT 17" Monitors. 500GB + 1.5TB HDD, Compro TV tuner, 350 WATT PSU
Post Reply