/    Sign up×
Community /Pin to ProfileBookmark

help me in select Value

Please any body help me

I hava a list box conatain Yes or No

<select name=”select1″ onChange=”checkAll();” >

<option value=”Yes”>Yes</option>
<option value=”No”>No</option>
</select>

if i change No then my other list box which come from loop
like

<select name=”a1″>

<option value=”Yes”>Yes</option>
<option value=”No”>No</option>
</select>

<select name=”a2″>

<option value=”Yes”>Yes</option>
<option value=”No”>No</option>
</select>

.
.
.
.

value change to NO , so i need a java script which perform the same

please reply me

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@JMRKEROct 20.2011 — Please any body help me

I hava a list box conatain Yes or No


<select name="select1" onChange="checkAll();" >

<option value="Yes">Yes</option>
<option value="No">No</option>
</select>


if i change No then my other list box which come from loop

like

<select name="a1">

<option value="Yes">Yes</option>
<option value="No">No</option>
</select>


<select name="a2">

<option value="Yes">Yes</option>
<option value="No">No</option>
</select>

.

.

.

.

value change to NO , so i need a java script which perform the same

please reply me[/QUOTE]


Huh??? ?

What does the function "checkAll()" supposed to do?

What loop are to referring to?

What value changes to "NO" to perform the same WHAT?

Your request is unclear to me. Need a bit more information as to what you want to accomplish. :eek:
Copy linkTweet thisAlerts:
@lovekhanauthorOct 21.2011 — ok i will clear u

i have a list box

<select name="select1" onChange="change();" >

<option value="Yes">Yes</option>
<option value="No">No</option>
</select>


Here change() is a function call

<script >

function change()

{

}

</script>

some java Script code above

above change function change all list box value like

<select name="a1">

<option value="Yes">Yes</option>
<option value="No">No</option>
</select>


<select name="a2">

<option value="Yes">Yes</option>
<option value="No">No</option>
</select>


..

..



this is list box may be 1 or more then 1 because its come from database record


same type of example is check box in yahoo mail or gmail when we click single check then all check boxes are checked if we removed check from single box then its remove from all boxes
Copy linkTweet thisAlerts:
@JMRKEROct 21.2011 — The only change from original post to the last was:
<i>
</i>
&lt;script &gt;

function change()
{
}
&lt;/script&gt;

which does nothing.

You request is still unclear to me. ?

Also ...

same type of example is check box in yahoo mail or gmail when we click single check then all check boxes are checked if we removed check from single box then its remove from all boxes
[/quote]

What checkboxes are to referring to in your postings?


I could make a code change but since I don't understand what the requirement are

the change I could make would probably not be to your liking as it would make no sense!

Do you have some live code to evaluate?

What you have posted does nothing! :eek:
Copy linkTweet thisAlerts:
@savvykmsOct 22.2011 — JMRKER, been a while bud. I think lovekhan wants a select element that will change all other select elements of the same type when it changes, to the same selection. E.g. a "global" select element:
[code=php]
<html>
<head>
<style type="text/css">
#masterBox,
#masterBox option { background-color: #000000; color: #ffffff; margin: 0px 0px; padding: 0px 0px; }
</style>
</head>
<body>
<label for="masterBox">Change all: </label>
<select id="masterBox" onchange="changeAll(this)">
<option value="0">Yes</option>
<option value="1">No</option>
</select>
<hr>
<script language="javascript" type="text/javascript">

var numberOfSelects = 3;
var prefix = "a";

function changeAll(master) {
if (!master) { return; }

for (i = 1; i <= numberOfSelects; i++) {
var ele = document.getElementById(prefix+""+i);
if (ele) {
ele.selectedIndex = master.selectedIndex;
}
}
}

for (i = 1; i <= numberOfSelects; i++) {
document.write("<select id=""+prefix+""+i+"">n");
document.write(" <option value="0">Yes</option>n");
document.write(" <option value="1">No</option>n");
document.write("</select>n");
}

</script>
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@JMRKEROct 22.2011 — JMRKER, been a while bud. I think lovekhan wants a select element that will change all other select elements of the same type when it changes, to the same selection. E.g. a "global" select element:

...
[/QUOTE]


Well, if that is what the OP wants,

you have made it clearer in one post than he/she has done in two! ?
Copy linkTweet thisAlerts:
@savvykmsOct 22.2011 — Well, if that is what the OP wants,

you have made it clearer in one post than he/she has done in two! ?[/QUOTE]


Thanks JMRKER, I tried. Nobody is great with English grammar or spelling all the time.
×

Success!

Help @lovekhan 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...