I definitely need some more help, I cannot get this if lark to work
out:
$(document).ready(function() {
$("#question").change(function() {
if ($("option:selected") == "good answer") {
$("#box2, "#autocomplete").attr("disabled", this.value ==
'no');
}
});
}
That makes sense, though the code is needed a second time elsewhere
and I think will require an 'if'. The fields are filled from the
database so the other options can be selected. PHP checks whether they
should be disabled or not at first but I need this disabled/enabled
behaviour.
Am I correct
That makes sense, though the code is needed a second time elsewhere
and I think will require an 'if'. The fields are filled from the
database so the other options can be selected. PHP checks whether they
should be disabled or not at first but I need this disabled/enabled
behaviour.
Am I correct i
Oh... I need to add an 'if' statement to it (at least that's how my
mind works after years with PHP!), something like this?
I don't think you'll need that, if I'm understanding your use case
correctly.
When this.value is evaluated, it automatically uses the selected option to
determine th
Thanks, that will do nicely. I have never used 'change' before - it
looks very useful.
On Jun 9, 8:55 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> You want the "change" event...give this a go.
>
> $("#question").change(function() {
> $("#box2, #autocomplete").attr("disabled", this.value
Oh... I need to add an 'if' statement to it (at least that's how my
mind works after years with PHP!), something like this?
$("#question").change(function() {
if !($("option:selected") == "This") {
$("#box2, #autocomplete").attr("disabled", this.value == 'no');
}
});
Simply I want to ask
You want the "change" event...give this a go.
$("#question").change(function() {
$("#box2, #autocomplete").attr("disabled", this.value == 'no');
});
-- Josh
- Original Message -
From: "Hinch" <[EMAIL PROTECTED]>
To: "jQuery (English)"
Sent: Monday, June 09, 2008 12:10 PM
Subject
7 matches
Mail list logo