- Screen name: Chris Cartrett
Chris Cartrett's Profile
3 Posts
7 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
I need to use a collection for this feature. I am trying to hide (or remove) the div.form-q element, but can't seem to select it. I have set up a console.log to try to see it's length.
What am I missing here? I know a table would be better suited for this, but I must use this collection.
- /*hide delete file & make dropdown required on additional attachments*/
var uploadFormat = function(){
var i = $(this).index();
var c = $('#q270 div.form-q').legnth;
var descrCell = $('#q270 div:nth-child('+i+')');
$(this).parents('ul').find('.attachmentType select').attr('required', 'true');
descrCell.find('td.delCell').hide();
//find(':button').remove();
console.log(c);
};
$('.addAttachmentUpload .fileuploader').on('updatevalidation', uploadFormat);
$('#q270 .cf-collection-append').click(uploadFormat);
HTML:
My idea is to try to get the number of div.form-q so I can traverse the DOM with the index I get back.
Thanks!
I am trying to make a function that has 2 functions within it. Here it works fine:
var bothFunctions = function(){//combine 2 function variables
checkCats();
checkCatVal();
};
$('#q119').on('change', bothFunctions);The functions them selves are performing some logic on a drop down list.
I tried using this technique on aother 2 functions that are performing logic based on a checkbox:
var bothFunctions = function(){//combine 2 function variables
checkPCardCheck;
checkPCardVal;
return false;
};$('#q34 .cf-table-add-row').click(bothFunctions);
What am I missing? Are there ever special conditions where you can't combine functions?
I can get them to work when I break them into separate lines:
$('#q34').on('change', checkPCardCheck);
$('#q34').on('change', checkPCardVal);
I also tried combining them like this with no luck:
$('#q34 .cf-table-add-row').click(function(){
checkPCardCheck();
checkPCardVal();
return false;
});I am a noob, so please forgive any blatantly obvious reasons that I don't see.
Thanks
Hi Everyone,
I have to be missing something pretty obvious, but I am out of ideas. I am trying to get the tr from a table (#q34). I am (attempting) to pass the table name as a parameter in to a function. I could be doing a number of things incorrectly as I am a complete noob.
here I am trying to pass the parameter #q34:
- $('.pCardUsedReg input').on('change', function(){
checkPCardCheck("#q34");
Here I trying to use the parameter as if it was text:
- var checkPCardCheck = function(x){
var totalRows = $(x+" tr").length-1;
I have tried several ways to format the parameter in function code to no avail. Thanks in advance!!
- «Prev
- Next »
- $('.pCardUsedReg input').on('change', function(){
- /*hide delete file & make dropdown required on additional attachments*/
Moderate user : Chris Cartrett
© 2013 jQuery Foundation
Sponsored by and others.

