Click here to Skip to main content
15,917,538 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Javascript Pin
ZurdoDev12-Apr-12 8:58
professionalZurdoDev12-Apr-12 8:58 
QuestionHow to find the row in the gridview that was selected Pin
MacIntyre4-Apr-12 13:24
MacIntyre4-Apr-12 13:24 
AnswerRe: How to find the row in the gridview that was selected Pin
Angel13209-Apr-12 20:52
Angel13209-Apr-12 20:52 
QuestionSenior Software Engineer (PayPal) Pin
jinrunping30-Mar-12 16:19
jinrunping30-Mar-12 16:19 
QuestionNewbie Question Pin
pix_programmer25-Mar-12 19:37
pix_programmer25-Mar-12 19:37 
AnswerRe: Newbie Question Pin
Dalek Dave26-Mar-12 22:34
professionalDalek Dave26-Mar-12 22:34 
GeneralRe: Newbie Question Pin
RichardGrimmer11-Apr-12 5:36
RichardGrimmer11-Apr-12 5:36 
AnswerRe: Newbie Question Pin
Richard MacCutchan27-Mar-12 22:34
mveRichard MacCutchan27-Mar-12 22:34 
GeneralRe: Newbie Question Pin
Benaiah Mischenko24-Apr-12 23:34
Benaiah Mischenko24-Apr-12 23:34 
Questionre-index array. Pin
Ethius23-Mar-12 8:40
Ethius23-Mar-12 8:40 
AnswerRe: re-index array. Pin
Jay Fesco23-Mar-12 10:33
Jay Fesco23-Mar-12 10:33 
GeneralRe: re-index array. Pin
Ethius27-Mar-12 0:58
Ethius27-Mar-12 0:58 
AnswerRe: re-index array. Pin
kingNull26-Mar-12 20:27
kingNull26-Mar-12 20:27 
QuestionHow to separate an array of checkboxes into groups Pin
SilverNightFall15-Mar-12 22:06
SilverNightFall15-Mar-12 22:06 
How would I alert the user if they selected more than one COP1000 and in another instance alert the user if they selected more than one COP 2830. Right now it notifies the user if they selected more than one class.


JavaScript
<script type="text/javascript" charset="utf-8">
    var p = 0;
    $(document).ready(function () {
        $('input:checkbox').click(function () {
            var COP1000 = $(this).attr('data');
            if ($('input:checkbox:is_checked').attr()) {
                p++;
            }
            if (p >= 2) {
                alert('You can only select this class once');
                return false; 
            }
        });
    });
<script>


Below are checkboxes with data being the name of the class

HTML
<input name="class[]" data="COP1000" value="<tr><td>COP1000 <td>8:00AM-9:00AM 
</td><td>MWF </td><td>Sanford </td><td>3</td></tr>" type="checkbox" class="auto-
style88"/>
<input name="class[]" data="COP1000" value="<tr><td>COP1000 <td>11:30AM-12:00PM
</td><td>TTH </td><td>Altamonte </td><td>3</td></tr>" type="checkbox" class="auto-
style88" />

<input name="class[]" data="COP2830" value="<tr><td>COP2830 <td>11:00AM-12:00PM 
</td><td>MWF </td><td>Sanford </td><td>3</td></tr>" type="checkbox" class="auto-
style88"/>
<<code><code></code></code>input name="class[]" data="COP2830" value="<tr><td>COP2830 <td>6:00PM-8:45PM 
</td><td>T </td><td>Altamonte </td><td>3</td></tr>" type="checkbox" class="auto-
style88"/>

AnswerRe: How to separate an array of checkboxes into groups Pin
BobJanova15-Mar-12 23:38
BobJanova15-Mar-12 23:38 
AnswerRe: How to separate an array of checkboxes into groups Pin
kingNull19-Mar-12 22:51
kingNull19-Mar-12 22:51 
QuestionAbout JavaScript Pin
Member 873345715-Mar-12 17:36
Member 873345715-Mar-12 17:36 
AnswerRe: About JavaScript Pin
V.15-Mar-12 23:12
professionalV.15-Mar-12 23:12 
GeneralRe: About JavaScript Pin
Manfred Rudolf Bihy15-Mar-12 23:48
professionalManfred Rudolf Bihy15-Mar-12 23:48 
QuestionjQueryUI - droppable Pin
killabyte15-Mar-12 10:23
killabyte15-Mar-12 10:23 
Questionjavascript Pin
madhusuthanan15-Mar-12 1:45
madhusuthanan15-Mar-12 1:45 
AnswerRe: javascript Pin
Member 457283216-Mar-12 16:39
Member 457283216-Mar-12 16:39 
AnswerRe: javascript Pin
Vasudevan Deepak Kumar21-Mar-12 9:52
Vasudevan Deepak Kumar21-Mar-12 9:52 
Questionget the bytes of input type="file" Pin
ThetaClear14-Mar-12 5:26
ThetaClear14-Mar-12 5:26 
AnswerRe: get the bytes of input type="file" Pin
Graham Breach14-Mar-12 9:16
Graham Breach14-Mar-12 9:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.