Search Results

Search found 2 results on 1 pages for 'devlshone'.

Page 1/1 | 1 

  • Using a variable in jQuery to perform a function...

    - by DevlshOne
    Can someone tell me what's wrong with this code? It doesn't seem to be recognizing the '#del[' + cid + ']' selector, at all. Which is the exact name of the ID in my PHP code. $(function() { var cid = '<?=$row['c_id'];?>'; $('#del[' + cid + ']').click(function() { alert('clicked!'); var oldqty = <?=$row['qty'];?>; var qtyID = "'" + '#qty' + cid + "'"; alert(qtyID); if ($(qtyID).is(':checked')) { $(this).(function() { $(this).val(0); }); }; if($(qtyID).not(':checked')) { $(this).(function() { $(this).val(0); }); }; }); }); Here's the PHP code that implement $row['c_id']: echo "<input class=\"number aln_center\" type=\"text\" name=\"qty[" . $row['c_id'] . "]\" id=\"qty" . $row['c_id'] . "\" value=\"" . $row['qty'] . "\" size=\"3\" onchange=\"return validateChgMLQty('qty" . $row['c_id'] . "'," . $row['qty'] . ");\" />\n"; echo "<input type=\"hidden\" name=\"telco[" , $row['c_id'] . "]\" id=\"telco" . $row['c_id'] . "\" value=\"" . $row['btelco'] . "\" />\n"; echo "<br />Delete\n"; echo "<input type=\"checkbox\" name=\"del[" . $row['c_id'] . "]\" id=\"del" . $row['c_id'] . "\" />\n"; I'm trying to get the value in the input statement to change to "0" if the "Delete" checkbox is clicked and then return back to it's original contents when unchecked. It never even gets to the first alert box, so it has nothing to do with qtyID and when viewing source, the 'var cid' line is populated with the correct integer passed from PHP variable $row['c_id'].

    Read the article

  • jQuery see if next element (not sibling) exists

    - by DevlshOne
    Here's my HTML code: <select class="grid_3 required jobData valid" id="clli" name="clli" style="font-size: 10px; border: none;"> <option value="0">Select One...</option> <option value="905"></option> <option value="931">0</option> <option value="1">ABRDMSES</option> </select> <img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png"> <img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png"> <img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png"> <select class="grid_3 required jobData" id="job_status" name="job_status" style="font-size: 10px; border: none;"> <option value="0">Select One...</option> </select> When a $('#clli').change(); occurs, I slap a caution image next to it to warn the user that there are changes to be saved. However, if they make more than one change to the same element, I first want to see if there is already a caution image there before sending a new one. Any theories/methods on how to just scope out the next (but not $.next()) element?

    Read the article

1