Radio button checked on dropdownlist change event
Moderator: General Moderators
Radio button checked on dropdownlist change event
hi,
I want to keep the checked radio button as checked on dropdownlist change event....How can i achieve this?
I want to keep the checked radio button as checked on dropdownlist change event....How can i achieve this?
Re: Radio button checked on dropdownlist change event
I'm not seeing how the two are connected. Changing the selected value of a set of radio buttons should have no effect on a select list and vice versa. That's default behaviour. Can you maybe show an example of what you're trying to achieve?
Re: Radio button checked on dropdownlist change event
hi,
yes i will provide the code.
I have two radio button and one dropdown list in my page
<input type="radio" class="rd" name="rdcode" id="rdnew" value="1" />New Code :
<input type="radio" class="rd" name="rdcode" id="rdexist" value="2" checked="checked" />Existing Code:
<select id="ddlItem" name="ddlItem" tabindex="1" onChange="getItem(this.value);">
<option value="0" selected="selected">--Select Item--</option>
<option value="1" >Apple</option>.....</select>
When page loads my Existing code radio button is defaulty checked....Thats fine for me...
But when I select the first radio, ie radiobutton for New Code(rdnew) and then try to change the dropdownlist item,
the second radiobutton is again showing as checked.But I want to keep the' rdnew' radio button as checked instead of rdexist.
thank you
yes i will provide the code.
I have two radio button and one dropdown list in my page
<input type="radio" class="rd" name="rdcode" id="rdnew" value="1" />New Code :
<input type="radio" class="rd" name="rdcode" id="rdexist" value="2" checked="checked" />Existing Code:
<select id="ddlItem" name="ddlItem" tabindex="1" onChange="getItem(this.value);">
<option value="0" selected="selected">--Select Item--</option>
<option value="1" >Apple</option>.....</select>
When page loads my Existing code radio button is defaulty checked....Thats fine for me...
But when I select the first radio, ie radiobutton for New Code(rdnew) and then try to change the dropdownlist item,
the second radiobutton is again showing as checked.But I want to keep the' rdnew' radio button as checked instead of rdexist.
thank you
Re: Radio button checked on dropdownlist change event
What is getItem? That looks to be where the problem lies.
Re: Radio button checked on dropdownlist change event
No...that is another javascript function ....Eventhough i remove that function ....my problem exists.....
Re: Radio button checked on dropdownlist change event
hi,
can you have any suggestion for my problem ?
can you have any suggestion for my problem ?
Re: Radio button checked on dropdownlist change event
I asked to see some code and you refused. What more do you want me to do? There's nothing in the code you have posted that explains that behaviour.
Re: Radio button checked on dropdownlist change event
o.k....see i don't have any problem to display my code....But when checked i didn't find any probs with that getitem()..Thats why i written like that....o.k sir....
I will prove the getItem ()
function getItem(cid)
{
var id= cid;
window.location.href="item.php?cid="+id;
}
I will prove the getItem ()
function getItem(cid)
{
var id= cid;
window.location.href="item.php?cid="+id;
}
Re: Radio button checked on dropdownlist change event
And there's the problem. You're reloading the page, which is resetting the form. What is it you're ultimately trying to do? I'm sure it can be accomplished differently.devd wrote:Code: Select all
window.location.href="item.php?cid="+id;
Re: Radio button checked on dropdownlist change event
I want to load another dropdownlist with the first ddl change event...so how can I accomplish this differently...as am new to php I dont know whether I am writing the coding correctly
Re: Radio button checked on dropdownlist change event
Make an AJAX call to a PHP script that will run the query and return the results. Check out jQuery.ajax