PHP or JQuery or CSS (in wordpress)- Show Div when Table data is displayed -


i using flexible map plugin on wordpress site. plugin has form allows user enter 'from address' directions location displayed on map. form not have id or class (and not able add one).

i user able print directions once form submitted, don't want print button show until after directions have displayed user pressing submit button.

the directions displayed in table, thinking use jquery when table displayed, show print div.

i'm thinking it's this, i'm not sure how format based on table (because form not have id):

jquery(document).ready(function($) {  $('#idofyourform').on("submit", function () { $('#print').show(); }); }); 

any suggestions appreciated!

edit here code generated once directions submit button pressed:

<div id="my-dir-div" style="float: left; direction: ltr;"> <form> <p> <input type="text" name="from"> <input type="submit" value="get directions"> </p> </form> <div jstcache="0"> <div class="adp-warnbox" jsdisplay="warnings.length" jstcache="1" style="display: none;"> <div class="warnbox-c2" jstcache="0"></div> <div class="warnbox-c1" jstcache="0"></div> <div class="warnbox-content" jscontent="$this" jsselect="warnings" jstcache="5"></div> <div class="warnbox-c1" jstcache="0"></div> <div class="warnbox-c2" jstcache="0"></div> </div> <div jseval="setuppanelstep(this, $waypointindex)" jsvalues="$waypointindex:0;" jsselect="legs[0].start_address" jstcache="2"> <table id="adp-placemark" class="adp-placemark" jstcache="0"> <tbody jstcache="0"> <tr jstcache="0"> <td jstcache="0"> <img jsvalues=".src:markericonpaths[$waypointindex]" jstcache="14" src="http://maps.gstatic.com/mapfiles/markers2/icon_greena.png"> </td> <td class="adp-text" jscontent="$this" jstcache="12">211 south elson street, kirksville, mo 63501, usa</td> </tr> </tbody> </table> </div> <div jsvalues="$legindex:$index;" jsselect="legs" jstcache="3" jsinstance="*0"> <div class="adp-legal" jscontent="copyrights" jstcache="4">map data ©2013 google</div> </div> </div> <div id="print"> <input id="print" class="printbtn" type="button" value="print directions" onclick="return pop_print()"> <script type="text/javascript"> function pop_print(){ w=window.open(null, 'print_page', 'scrollbars=yes'); w.document.write(jquery('div#my-dir-div').html()); w.document.close(); w.print(); } </script> </div> 

i think can try (only if table id adp-placemark available on page show it)

$(function(){     if($('#my-dir-div table#adp-placemark').length) $('#print').show(); }); 

or, one

$(function(){     if($('#my-dir-div table#adp-placemark td.adp-text').length) $('#print').show(); }); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -