I have a gridview that when the select button is pressed a bootstrap modal window opens and is populated by the gridview row values (LBEdit button below). That works great.
The problem is as follows:
In that modal pop ups some divs are hidden and need to be shown only if a certain value == "Yes" in the gridview row. I manage to capture the values when the gridview loads but the divs remain hidden.
ID is unique value in the html page, so don't repeat same ID multiple times, if you repeat same ID, the jQuery will trigger the event for only in the last DOM element.
Member
5 Points
29 Posts
Show / Hide Div based on gridview row value not displaying properly
Feb 03, 2015 12:32 PM|HuggyBearWasHere|LINK
I have a gridview that when the select button is pressed a bootstrap modal window opens and is populated by the gridview row values (LBEdit button below). That works great.
The problem is as follows:
In that modal pop ups some divs are hidden and need to be shown only if a certain value == "Yes" in the gridview row. I manage to capture the values when the gridview loads but the divs remain hidden.
My code is below. Any help would be appreciated.
Webforms JQuery gridview
None
0 Points
2 Posts
Re: Show / Hide Div based on gridview row value not displaying properly
Feb 03, 2015 08:34 PM|kabilan9929|LINK
I dono how you having your div's in your page , try to use CLASS to pick the div element instead of using ID .
Webforms JQuery gridview
Member
5 Points
29 Posts
Re: Show / Hide Div based on gridview row value not displaying properly
Feb 03, 2015 08:37 PM|HuggyBearWasHere|LINK
Why would that make any difference if I am targeting the divs specifically by their ID?
Webforms JQuery gridview
Star
8536 Points
1376 Posts
Re: Show / Hide Div based on gridview row value not displaying properly
Feb 04, 2015 01:22 AM|Edwin Guru Singh|LINK
As per your case, you can try the following steps :
1.Goto the browser->View->Source
2.Search & copy the corresponding div id from viewsource
3 .then replace that viewsource div_id into your jQuery
--
with regards,
Edwin
Webforms JQuery gridview
Edwin
Participant
849 Points
352 Posts
Re: Show / Hide Div based on gridview row value not displaying properly
Feb 04, 2015 01:48 AM|arunabathan|LINK
Hi,
ID is unique value in the html page, so don't repeat same ID multiple times, if you repeat same ID, the jQuery will trigger the event for only in the last DOM element.
Check javascript scope of variable here
In your code, you can't access local variable("IsPropertyInForeclosure") outside. So it should be global variable. Just check modified code below.
Scenario 1
Scenario 2
Webforms JQuery gridview
Arunabathan.G
(Please mark as answer, if your thread is solved)
Member
5 Points
29 Posts
Re: Show / Hide Div based on gridview row value not displaying properly
Feb 04, 2015 09:18 AM|HuggyBearWasHere|LINK
Thank you all for the responses. I will try the recommendations as soon as I can and will report back.
Webforms JQuery gridview