Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Screen name:
jelly
jelly's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
Checking the second of 2 dynamically generated radio buttons
[2Replies]
12-Feb-2014 09:59 AM
Forum:
Using jQuery
I'm trying to check the second radio button in a pair of 2 that are dynamically created in the front-end .cshtml page. The code is as follows:
<div class="g6">
<form>
@foreach (var method in myProxy.GetCategorys())
{
<input type="radio" name="myCat" data-bind="@MVVM.CheckedBindingFor(a => a.Category)" value="@method.Code"/>
<label class="radio-inline">@method.Name</label>
}
</form>
</div>
It produces 2 radio button like this in the rendered source code:
<input type="radio" name="myCat" value="ABC" data-blur-setup="true">
<input type="radio" name="myCat" value="DEF" data-blur-setup="true">
I am trying to have the second one ie "DEF" enabled.
This works from the Chrome console:
$(':radio[value="DEF"]').prop('checked', true);
But does not work from the corresponding ViewModel.
Its firing before the page has fully loaded. Anyone with any ideas?
I tried adding some Javascript to the chstml page but it wont accept it.
Any nice quick ideas?
«Prev
Next »
Moderate user : jelly
Forum