Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Design Forum > HTML / CSS
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-15-2006, 12:49 PM   #1 (permalink)
awieland
Junior Member
 
Join Date: Aug 2006
Posts: 1
Default Javascript Syntax

In my Javascript I want to add a third section, which calls a "option C" in my select statement. I am not able to get the correct syntax in the Javascript. Using the return in the javascript in the current location will show the first and second section, but when I add the third section nothing works. Does anyone have any ideas on the syntax?. In addtion, I want to stay with this format in the the Javascript.

<!-- javascript: -->

<script language="JavaScript1.2">
function whichColour(obj){

if(obj.group_name.selectedIndex == 1)
<!-- Section 1 -->
{
obj.directory.length=2
obj.directory.options[0].value="msds_pds/QEP Product Data Sheets/"
obj.directory.options[0].text="msds_pds/QEP Product Data Sheets/"
obj.directory.selectedIndex = 0
return
}
<!-- Section 1 -->
obj.directory.length=2
obj.directory.options[0].value="msds_pds/CANADA/Product Data Sheet/CANPDS/"
obj.directory.options[0].text="msds_pds/CANADA/Product Data Sheet/CANPDS/"
obj.directory.selectedIndex = 0

<!-- Section 3, this is the section I want to add but the syntax is not correct-->

obj.directory.length=2
obj.directory.options[0].value="msds_pds/test/"
obj.directory.options[0].text="msds_pds/test/"
obj.directory.selectedIndex = 0
}

</script>

<!-- Select statement: -->

<td>
<select name="selectBorder" onchange="whichColour(this.form)">
<option>-- select --</option>
<option value="QEP Product Datasheets">QEP Product Datasheets</option>
<option value="Roberts Adhesive Product Datasheets (Canada English)">Roberts Adhesive Product Datasheets (Canada English)</option>
<option value="Roberts Adhesive Product Datasheets (USA)">Roberts Adhesive Product Datasheets (USA)</option>
</select>
</td>

<td>
<select name="selectColour" onchange="whichColour(this.form)">
<option>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</td>
awieland is offline   Reply With Quote
Sponsored Links
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 12:51 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums