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

JavaScript

 
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 
GeneralRe: get the bytes of input type="file" Pin
ThetaClear14-Mar-12 20:12
ThetaClear14-Mar-12 20:12 
QuestionIssues when using .Live Pin
nitin_ion13-Mar-12 18:19
nitin_ion13-Mar-12 18:19 
QuestionEvent: JavaOne and Oracle Develop 2-12 Pin
alphauser612-Mar-12 4:03
alphauser612-Mar-12 4:03 
AnswerRe: Event: JavaOne and Oracle Develop 2-12 Pin
Richard MacCutchan12-Mar-12 4:34
mveRichard MacCutchan12-Mar-12 4:34 
QuestionFunction.name property missing on IIS/Jscript Pin
captnmac9-Mar-12 7:12
captnmac9-Mar-12 7:12 
Questionread data from website Pin
Member 79044828-Mar-12 22:01
Member 79044828-Mar-12 22:01 
AnswerRe: read data from website Pin
captnmac9-Mar-12 7:17
captnmac9-Mar-12 7:17 
SuggestionTo disable Back space using javascript Pin
Lalit PB5-Mar-12 22:48
Lalit PB5-Mar-12 22:48 
GeneralRe: To disable Back space using javascript Pin
R. Giskard Reventlov6-Mar-12 10:16
R. Giskard Reventlov6-Mar-12 10:16 
QuestionReading Address Before Browser Loads It? Pin
weinerschizel5-Mar-12 15:26
weinerschizel5-Mar-12 15:26 
AnswerRe: Reading Address Before Browser Loads It? Pin
Luc Pattyn5-Mar-12 17:07
sitebuilderLuc Pattyn5-Mar-12 17:07 
GeneralRe: Reading Address Before Browser Loads It? Pin
BobJanova5-Mar-12 23:52
BobJanova5-Mar-12 23:52 

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.