4xjbh Posted August 19, 2013 Share Posted August 19, 2013 Hi all, I have this form that has a label with a click event mapped to toggle the visibility of a textarea and it worked great until I setup 2 combo boxes with an ajax call for the second. After opening the form the toggle on #notes_sh works ok. If I set values in the 2 combo boxes and then try to select the #notes_sh label there is no event fired. I have no errors coming up in my js console. Any ideas why this toggle it not firing after setting values in the combo boxes? James ps. Occurs on both Chrome and Firefox. $("#notes_sh").click(function(){ // Notes show and hide toggle, off by default, $("#fld_notes").toggle(); $('#category_id').change( function() { checkCategory(); // checks value and enables/disables subcategory control var catid = $(this).val(); var dataString = 'catid='+catid; $.ajax ({ type: "POST", url: "catalogues.php", data: dataString, cache: false, success: function(data) { $('#subcategory_id').html(data).focus(); } }); }); // Get subcategory_id records for select box if(isset($_POST['catid'] )) { $catid=$_POST['catid']; $sql_subcategory = "SELECT catalogues_categories.id, catalogues_categories.category, catalogues_categories.parent_id, catalogues_categories.inuse FROM catalogues_categories WHERE catalogues_categories.parent_id = '$catid' AND catalogues_categories.inuse = 1 ORDER BY catalogues_categories.category ASC"; $query_subcategory = $conn->query($sql_subcategory); $results_subcategory = $query_subcategory->fetchAll(); echo '<option value= "-1"> Please Select </option>'; foreach ( $results_subcategory as $row ){ echo '<option value="'.$row['id'].'">'.$row['category'].'</option>'; } $conn = null; // Play it safe and close the connection $_POST['catid'] = null; // Reset post category id as we dont need it any more. } else { $results_subcategory = null; } Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/ Share on other sites More sharing options...
jazzman1 Posted August 20, 2013 Share Posted August 20, 2013 So, if I understand you correctly, you get some values from these 2 drop-down lists by Ajax using the jquery change event. After that, you try to toggle it inside "#fld_notes" by clicking on #notes_sh label and nothing happens, right? Can you post out all relevant js code and some sample with html data. Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445901 Share on other sites More sharing options...
4xjbh Posted August 20, 2013 Author Share Posted August 20, 2013 I select the label '#notes_sh' to show/hide the text area '#fld_notes. http://youtu.be/6olI1MdnJlc catalogues.php <script src="javascript/jquery-1.10.2.min.js"> </script> <script> $(document).ready(function(){ // ---------------------------------------------------------------------------------------------------------------------------------- // Things to do after page loads var search_watermark = 'Search here'; $('#search').val(search_watermark).addClass('watermark'); // Add the search water mark to the search field. $("#fld_notes").hide(); // Hide the notes text area. // ---------------------------------------------------------------------------------------------------------------------------------- $('#new').click( function() { // $(".message").hide(); $('.message').text("New Catalogue"); $('#category_id').val("Please Select"); //reset showDialog(); checkCategory(); }); $('#category_id').change( function() { checkCategory(); // checks value and enables/disables subcategory control var catid = $(this).val(); var dataString = 'catid='+catid; $.ajax ({ type: "POST", url: "catalogues.php", data: dataString, cache: false, success: function(data) { $('#subcategory_id').html(data).focus(); } }); }); $('#close').click( function() { hideDialog(); }); $("#notes_sh").click(function(){ // Notes show and hide toggle, off by default, $("#fld_notes").toggle(); }); $("#save").click(function(){ // Notes show and hide toggle, off by default, // So some save activity here $(".message").show().addClass("message_success", "message").text("Record saved successfully."); setTimeout(function() { $('.message').removeClass("message_success").text("Saved record title and file code goes here."); }, 5000); }); // ---------------------------------------------------------------------------------------------------------------------------------- // JS functions function hideDialog() { // Hide the dialog $('#dialog').fadeOut("slow"); $('#dialog_wrapper').fadeOut("slow"); } function showDialog() { // Show the dialog $('#dialog_wrapper').fadeIn(); $('#dialog').fadeIn("slow"); } // If category was changed adjust select boxes to suit. If category equals 'Please Select', sub-category should be disabled and set to 'Please Select' function checkCategory() { if ($('#category_id').val() == 'Please Select') { $('#subcategory').hide(); } else { $('#subcategory').show(); } } }); </script> <?php $pagetitle = "Catalogues"; // Set template page title require "includes/connection.php"; require_once 'library/twig/lib/Twig/Autoloader.php'; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem('templates'); $twig = new Twig_Environment($loader, array('cache' => 'compilation_cache','debug' => true )); $template = $twig->loadTemplate('catalogues.html'); // ---------------------------------------------------------------------------------------------------------------------------------- // No matter what get all of the records and desplay them to the template $sql = "SELECT catalogues.id, catalogues.title, catalogues.manufacturer, catalogues.keywords, catalogues.file_code, catalogues.modified, catalogues.media_id, catalogues.website, catalogues.category_id, catalogues.subcategory_id, catalogues.author_id, catalogues.created, companies.company_name, catalogues_categories.category AS category_name, catalogues_categories.category, catalogues_subcategories.category AS subcategory_name FROM catalogues LEFT JOIN companies ON catalogues.manufacturer = companies.id LEFT JOIN catalogues_categories ON catalogues.category_id = catalogues_categories.id LEFT JOIN catalogues_categories AS catalogues_subcategories ON catalogues.subcategory_id = catalogues_subcategories.id"; $results=$conn->query($sql); $count = $results->rowCount(); // --------------------------------- // Get media_id array for select box $sql_manuf = "SELECT companies.id, companies.company_name FROM companies ORDER BY companies.company_name ASC"; $query_manuf = $conn->query($sql_manuf); $results_manuf = $query_manuf->fetchAll(); // --------------------------------- // Get category_id records for select box $sql_category = "SELECT catalogues_categories.id, catalogues_categories.category, catalogues_categories.parent_id, catalogues_categories.inuse FROM catalogues_categories WHERE catalogues_categories.parent_id = 0 AND catalogues_categories.inuse = 1 ORDER BY catalogues_categories.category ASC"; $query_category = $conn->query($sql_category); $results_category = $query_category->fetchAll(); // --------------------------------- // Get subcategory_id records for select box if(isset($_POST['catid'] )) { $catid=$_POST['catid']; $sql_subcategory = "SELECT catalogues_categories.id, catalogues_categories.category, catalogues_categories.parent_id, catalogues_categories.inuse FROM catalogues_categories WHERE catalogues_categories.parent_id = '$catid' AND catalogues_categories.inuse = 1 ORDER BY catalogues_categories.category ASC"; $query_subcategory = $conn->query($sql_subcategory); $results_subcategory = $query_subcategory->fetchAll(); echo '<option value= "-1"> Please Select </option>'; foreach ( $results_subcategory as $row ){ echo '<option value="'.$row['id'].'">'.$row['category'].'</option>'; } $conn = null; // Play it safe and close the connection $_POST['catid'] = null; // Reset post category id as we dont need it any more. } else { $results_subcategory = null; } // --------------------------------- // Get media_id array for select box $sql_media = "SELECT catalogues_media.id, catalogues_media.media FROM catalogues_media ORDER BY catalogues_media.media ASC"; $query_media = $conn->query($sql_media); $results_media = $query_media->fetchAll(); // ---------------------------------------------------------------------------------------------------------------------------------- // Output template variables echo $template->render(array( 'results' => $results, 'pagetitle' => $pagetitle, 'count' => $count, 'results_manuf' => $results_manuf, 'results_media' => $results_media, 'results_category' => $results_category )); ?> html: <div class="dialog_form"> <div class="message" > </div> <div style='float: left'> <div class='field'><label>Title:</label><input class="field" id='title' name="title" type='text' value= {{ row.title }} ></div> <div class='field'><label>Manufacturer:</label> <select class="required" id="manufacturer" name="manufacturer"> <option>Please Select </option> {% for row_manuf in results_manuf %} <option value= {{ row_manuf.id }} > {{ row_manuf.company_name }} </option> {% endfor %} </select> </div> <div class='field'><label>File Code:</label><input class="field" type='text' name='file_code' value= {{ row.file_code }} ></div> <div class='field'><label>Catalogue URL:</label><input class="field" type='text' name='website' value= {{ row.website }} ></div> </div> <div style='float: right'> <div class='field'><label>Media:</label> <select class="required" id="media_id" name="media_id"> <option>Please Select </option> {% for row_media in results_media %} <option value= {{ row_media.id }} > {{ row_media.media }} </option> {% endfor %} </select> </div> <div class='field'><label>Category:</label> <select class="required" name="category_id" id="category_id"> <option>Please Select </option> {% for row_category in results_category %} <option value= {{ row_category.id }} > {{ row_category.category }}</option> {% endfor %} </select> </div> <div class='field' id="subcategory"><label >Sub-category:</label> <select class="required" name="subcategory_id" id="subcategory_id"> <option>Please Select </option> </select> </div> </div> <div style='clear:both;'><br/> <label >Notes:</label> <label id="notes_sh" >Show/Hide</label><br/> <textarea id="fld_notes" name="notes" rows="10" cols="128"> {{ row.notes }} </textarea><br/> <label>Keywords:</label><br/> <input style="width:100%;" type='text' name='keywords' value= {{ row.keywords }} > </div> <div style='text-align: right ; margin-top: 20px; clear:both;'> Multiple <input type='checkbox' name='multiple' > <input type='hidden' name='id' value= {{ row.id }} > <input class='Button' id='save' type='submit' value='Save' name='save'> <input id="close" class='button' type='button' value='close' name='close' > </div> </div> catalogues.html catalogue_form.html Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445905 Share on other sites More sharing options...
jazzman1 Posted August 20, 2013 Share Posted August 20, 2013 (edited) No, don't push me to use twig Give us the generated html code. Open up the source code of this html document and post out the result. Edited August 20, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445908 Share on other sites More sharing options...
4xjbh Posted August 20, 2013 Author Share Posted August 20, 2013 Attached Catalogues.htm Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445911 Share on other sites More sharing options...
jazzman1 Posted August 20, 2013 Share Posted August 20, 2013 I will check tomorrow. There is too much code for this time of the night Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445913 Share on other sites More sharing options...
jazzman1 Posted August 20, 2013 Share Posted August 20, 2013 (edited) As a result of using the template engine, you were include the same js-library code twice on your templates. The HTML source output should be similar like that: <!-- saved from url=(0041)http://localhost/corearch2/catalogues.php --> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script src="http://code.jquery.com/jquery-1.10.1.min.js"></script><style type="text/css"></style> <script> $(document).ready(function(){ // ---------------------------------------------------------------------------------------------------------------------------------- // Things to do after page loads var search_watermark = 'Search here'; $('#search').val(search_watermark).addClass('watermark'); // Add the search water mark to the search field. $("#fld_notes").hide(); // Hide the notes text area. // ---------------------------------------------------------------------------------------------------------------------------------- $('#new').click( function() { // $(".message").hide(); $('.message').text("New Catalogue"); $('#category_id').val("Please Select"); //reset showDialog(); checkCategory(); }); $('#category_id').change( function() { checkCategory(); // checks value and enables/disables subcategory control console.log(true); return false; var catid = $(this).val(); var dataString = 'catid='+catid; $.ajax ({ type: "POST", url: "catalogues.php", data: dataString, cache: false, success: function(data) { $('#subcategory_id').html(data).focus(); } }); }); $('#close').click( function() { hideDialog(); }); $("#notes_sh").click(function(){ // Notes show and hide toggle, off by default, $("#fld_notes").toggle(); }); $("#save").click(function(){ // Notes show and hide toggle, off by default, // So some save activity here $(".message").show().addClass("message_success", "message").text("Record saved successfully."); setTimeout(function() { $('.message').removeClass("message_success").text("Saved record title and file code goes here."); }, 5000); }); // ---------------------------------------------------------------------------------------------------------------------------------- // JS functions function hideDialog() { // Hide the dialog $('#dialog').fadeOut("slow"); $('#dialog_wrapper').fadeOut("slow"); } function showDialog() { // Show the dialog $('#dialog_wrapper').fadeIn(); $('#dialog').fadeIn("slow"); } // If category was changed adjust select boxes to suit. If category equals 'Please Select', sub-category should be disabled and set to 'Please Select' function checkCategory() { if ($('#category_id').val() == 'Please Select') { $('#subcategory').hide(); } else { $('#subcategory').show(); } } }); </script> <title>Catalogues</title> <link href="./Catalogues_files/layout.css" type="text/css" rel="stylesheet"> <link href="./Catalogues_files/default.css" type="text/css" rel="stylesheet"> </head> <body style=""> <div class="wrapper"> <div id="dialog_wrapper" style="display: none;"> </div> <div id="dialog" style="display: block"> <div class="dialog_form"> <div class="message">New Catalogue</div> <div style="float: left"> <div class="field"><label>Title:</label><input class="field" id="title" name="title" type="text" value=""></div> <div class="field"><label>Manufacturer:</label> <select class="required" id="manufacturer" name="manufacturer"> <option>Please Select </option> <option value="444"> TEKFORM - Duropal </option> <option value="762"> 3Form </option> <option value="372"> 3M Scotchshield </option> <option value="812"> 3S Lighting </option> <option value="527"> A Sign Design </option> <option value="641"> A1 Rubber </option> <option value="261"> AAF Australian Aluminium Finishing </option> <option value="456"> Abax Systems </option> <option value="474"> Abbott's Office Furniture </option> <option value="33"> Abet </option> </select> </div> <div class="field"><label>File Code:</label><input class="field" type="text" name="file_code" value=""></div> <div class="field"><label>Catalogue URL:</label><input class="field" type="text" name="website" value=""></div> </div> <div style="float: right"> <div class="field"><label>Media:</label> <select class="required" id="media_id" name="media_id"> <option>Please Select </option> <option value="3"> CD/DVD </option> <option value="1"> Folder </option> <option value="2"> Leaflett/Brochure </option> <option value="4"> Sample </option> </select> </div> <div class="field"><label>Category:</label> <select class="required" name="category_id" id="category_id"> <option>Please Select </option> <option value="1"> Building Systems</option> <option value="17"> Completetion of structure</option> <option value="21"> External works</option> <option value="23"> Finishes</option> <option value="20"> Fittings</option> <option value="22"> General products, building materials</option> <option value="19"> Services - electrical</option> <option value="18"> Services - mechanical</option> <option value="24"> Special activities, requirements</option> <option value="3"> Structure</option> <option value="2"> Sub-Structure</option> </select> </div> <div class="field" id="subcategory" style="display: block;"><label>Sub-category:</label> <select class="required" name="subcategory_id" id="subcategory_id"> <option value="-1"> Please Select </option><option value="33">Access Floors</option><option value="34">Balustrades</option><option value="29">Doors: general</option><option value="28">Doors: industrial</option><option value="30">Doors: parts, accessories</option><option value="25">External & entrance screens</option><option value="31">Lintels, sills, weather bars, other</option><option value="36">Rooflights</option><option value="32">Room dividers, internal grilles etc.</option><option value="35">Suspended ceilings</option><option value="26">Windows</option><option value="27">Windows: parts, accessories</option><br> <font size="1"><table class="xdebug-error xe-fatal-error" dir="ltr" border="1" cellspacing="0" cellpadding="1"> <tbody><tr><th align="left" bgcolor="#f57900" colspan="5"><span style="background-color: #cc0000; color: #fce94f; font-size: x-large;">( ! )</span> Fatal error: Call to a member function query() on a non-object in C:\Users\james.bh\Insync\www\corearch2\catalogues.php on line <i>243</i></th></tr> <tr><th align="left" bgcolor="#e9b96e" colspan="5">Call Stack</th></tr> <tr><th align="center" bgcolor="#eeeeec">#</th><th align="left" bgcolor="#eeeeec">Time</th><th align="left" bgcolor="#eeeeec">Memory</th><th align="left" bgcolor="#eeeeec">Function</th><th align="left" bgcolor="#eeeeec">Location</th></tr> <tr><td bgcolor="#eeeeec" align="center">1</td><td bgcolor="#eeeeec" align="center">0.0016</td><td bgcolor="#eeeeec" align="right">280352</td><td bgcolor="#eeeeec">{main}( )</td><td title="C:\Users\james.bh\Insync\www\corearch2\catalogues.php" bgcolor="#eeeeec">..\catalogues.php<b>:</b>0</td></tr> </tbody></table></font> </select> </div> </div> <div style="clear:both;"><br> <label>Notes:</label> <label id="notes_sh">Show/Hide</label><br> <textarea id="fld_notes" name="notes" rows="10" cols="128" style="display: none;"> </textarea><br> <label>Keywords:</label><br> <input style="width:100%;" type="text" name="keywords" value=""> </div> <div style="text-align: right ; margin-top: 20px; clear:both;"> Multiple <input type="checkbox" name="multiple"> <input type="hidden" name="id" value=""> <input class="Button" id="save" type="submit" value="Save" name="save"> <input id="close" class="button" type="button" value="close" name="close"> </div> </div> </div> <div id="header"> <div class="content"> </div> </div> <div id="menu"> </div> <div id="toolbar"> <div class="content" style="padding: 20px;"> <div style="float: left"> <input id="new" class="button" name="new" value="New Catalogue" type="button"> </div> <div style="float: right"> <span> 10 Records</span> <input id="search" class="search watermark" type="text" name="search" value=""> <input class="button" type="submit" value="Search" name="btnSearch"> </div> </div> <!-- end toolbar content div --> </div> <div id="body"> <div class="content"> <table class="grid"> <tbody><tr class="grid"> <!-- <th class='grid_th'></th>--> <th class="grid">Catalogue</th> <th class="grid">Manufacturer</th> <th class="grid">Category</th> <th class="grid">Sub-Category</th> <th class="grid">Office</th> <th class="grid">Media</th> <th class="grid">File</th> <th class="grid" width="75px"> </th> <!-- Detail hyper-link column --> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Madinoz Pty Ltd</td> <td class="grid">Madinoz Pty Ltd</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=2">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=2">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Fitzroy Track Systemss</td> <td class="grid">Charles Marshall Pty Ltd</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=3">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=3">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Automated Disability Access Systems</td> <td class="grid">ADAS Pty Ltd</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=4">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=4">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Cabinet Hardware Supplies</td> <td class="grid">Cabinet Hardware Supplies</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=5">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=5">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Contract Hardware</td> <td class="grid">Cabinet Hardware Supplies</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=6">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=6">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">D Line</td> <td class="grid">Keeler Hardware</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=7">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=7">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Olivari</td> <td class="grid">Bellevue Imports Pty Ltd</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=8">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=8">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Style Finish Hardware</td> <td class="grid">Style Finish </td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=9">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=9">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">Centor Sliding Door Tracks</td> <td class="grid">Centor Products Pty Ltd</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=10">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=10">Detail</a> </td> </tr> <tr class="grid"> <!-- <td class='grid_td'> <input type="checkbox" name="selectedrow[]" value="<?php echo $row['id']; ?>" > </td> --> <td class="grid">O'Briens Automatic Door & Gate Systems</td> <td class="grid">KABA Door Systems</td> <td class="grid">Completetion of structure</td> <td class="grid">Doors: parts, accessories</td> <td class="grid" style="width:120px;"> BNE | SC | HB</td> <td class="grid">1</td> <td class="grid">31.59</td> <td class="grid" style="text-align: right;"><a href="http://localhost/corearch2/catalogue_detail.php?id=11">Edit</a> | <a href="http://localhost/corearch2/catalogue_detail.php?id=11">Detail</a> </td> </tr> </tbody></table> <br> </div> <!-- end of body content --> </div> <div id="footer"> <div class="content"> Copyright 2013 </div> </div> </div> <div id="directions_extension" style="display: none;"></div></body></html> Include the js library only once inside the header template file and be careful when you're creating your templates structure. Edited August 20, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445916 Share on other sites More sharing options...
4xjbh Posted August 20, 2013 Author Share Posted August 20, 2013 Thank you for your time but I fail to see what the problem actually is. The js library code only exists in one location and occurs one in the html. Changing it to be loaded from the code library has no change. Attached is a view-source copy and paste instead of a save as from the browser which changes the headers etc. Where have I missed your point, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445920 Share on other sites More sharing options...
4xjbh Posted August 20, 2013 Author Share Posted August 20, 2013 attached file catalogues.html Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445922 Share on other sites More sharing options...
jazzman1 Posted August 20, 2013 Share Posted August 20, 2013 It's a different source code in comparison with previous one. All js code should be inside HTML tags (just to mention) and works fine for me. Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1445949 Share on other sites More sharing options...
4xjbh Posted August 20, 2013 Author Share Posted August 20, 2013 OK, I removed my JS from the php file and put it in a twig block in the catalogues template which extends the main layout single.html and it works fine now. Thank you very much jazzman. Quote Link to comment https://forums.phpfreaks.com/topic/281376-toggle-failure-after-ajax-fire/#findComment-1446042 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.