/    Sign up×
Community /Pin to ProfileBookmark

Javascript and Value

Different topic from the last.

With this code, when I select an option from the first box, the 2nd box populates with the options. But where are the values of the 2nd box? I am trying to have it stored in my Database for both boxes, the first one works, but the 2nd one doesent.

[CODE] <head>

<script type=”text/javascript”>

function updateEvent(page){

var type = document.getElementById(“type”);

/* Reset old types if the country has been changed */

var oldLength = type.length;

for (i = oldLength; i >= 0; i–)

type.options[i] = null;

/* Set up the types for the country codes */

var eventType = new Array();

eventType[“Wedding”] = new Array(“Ceremony”,”Reception”,”Ceremony & Reception”);

eventType[“School”] = new Array(“Dance”,”Prom”);

for(i=0;i<eventType[page.value].length;i++){

type.options[i] = new Option(eventType[page.value][i],eventType[page.value][i]);

}

}
</script></head>

<select name=”page” id=”page” onchange=”updateEvent(this);” value='<? echo ($_REQUEST[page]); ?>’>
<option selected value=”<? echo ($_REQUEST[page]); ?>”><? echo ($_REQUEST[page]); ?></option>
<option value=”Wedding”>Wedding</option>
<option value=”School”>School</option>
</select>
<select name=”type” id=”type” value='<? echo ($_REQUEST[eventtype]); ?>’>

<option selected value=”<? echo ($_REQUEST[page]); ?>”><? echo ($_REQUEST[eventtype]); ?></option>
</select>[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@comptech520authorMar 03.2006 — Any ideas on this guys?
×

Success!

Help @comptech520 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...