last day (15 days later) » 

9:11 PM
0
Q: Zebra Calender Picker on Dynamic Field

Pradyumna Swain I'm using Zebra Calender Picker in my Project. I'm successfully getting calender picker in my static pages. $(document).ready(function() { $('#dob').Zebra_DatePicker({ format:'d-m-y', view:'years' }); }); 2. Now in Second page Where a form will b...

 
should not make a difference, but have you tried using document instead of '#PA2' -> $(document).on("click", "#pa2dob", function () {
 
It does n't make any difference. same as using ID
 
Is there a id="pa2dob" in each Add This Risk link? Or is id="pa2dob" unique in the page?
 
pa2dob is unique one. only available once in PA2 and that too created dynamically. It's available only after clicking on PA2
 
So is id="PA2" unique as well?
 
9:11 PM
yes. It's unique too
 
Is id="PA2" dynamically created, or just id="pa2dob"?
 
Only pa2dob is dynamically created on clicking on PA2 i.e. pa2dob not available on initial page load. only PA2 is avialble on page load
 
So what does your html source code look like?
 
<div id="PA2">
<?php
if ($web->getRiskDtl('PA2') == false) {
echo "<div class=\"sectionHead\" onclick=\"return procRisk(null,'PA2',false,null,true,false,false);\"><span style=\"float:left;\">Personal Accident</span>";
echo "<span class=\"sectionAdd\">Add This Risk</span></div>";
echo "<div id=\"PA2Load\"><!-- --></div>";
}
?>
</div>
 
Do you have a <div id="PA2"> wrapping all your headers - Private All Risk, Personal Accident, Motor Cycles?
 
9:16 PM
<div id="PA2">
<div class="sectionHead">
Personal Accident:</div>
<div id="PA2Load">
<fieldset class="fieldset">
<legend>Add Risk</legend><div class="grid"><div class="gridRow"><div class="gridCol1"><b>Item Description</b></div><div class="gridCol"><b>Sum Insured</b></div></div><form id="PA2Form" method="post" action="" onclick="return false;"><div class="grid"><div class="gridRow"><div class="gridCol1">Death Benefits Sum Insured (US$):</div><div class="gridCol"><div class="tipField" onclick="showInput('pa2DTHSIGRSR','reqpa2DTHSIGRSR','PA2Form');"><input class="tipInput" type="text" id="pa2
No buddy
Generated code on click
Actually all the fields are in xml file and fields created using PHP XMl Parsing
 
Your image shows html that looks like `<div id="PA2"><div class="sectionHead">
Private All Risk:<span class=\"sectionAdd\">Add This Risk</span></div> <div id="PA2Load"></div> <div id="PA2"><div class="sectionHead">
Personal Accident:<span class=\"sectionAdd\">Add This Risk</span></div> <div id="PA2Load"></div>`
 
yes
no no
<div id="PAR">
<?php
if ($web->getRiskDtl('PAR') == false) {
echo "<div class=\"sectionHead\" onclick=\"return procRisk(null,'PAR',false,null,true,false,false);\"><span style=\"float:left;\">Private All Risk</span>";
echo "<span class=\"sectionAdd\">Add This Risk</span></div>";
echo "<div id=\"PARLoad\"><!-- --></div>";
}
?>
</div>
<div id="PA2">
<?php
if ($web->getRiskDtl('PA2') == false) {
echo "<div class=\"sectionHead\" onclick=\"return procRisk(null,'PA2',false,null,true,false,false);\"><span style=\"float:left;\">Personal Accident</span>";
PAR and PA2 independent of each other
 
Is $("#PA2").on("click", "#pa2dob", function () { ... } inside your function procRisk() or inside a $(document).ready({...})/$(function(){...}) block?
 
inside $(document).ready'
 
Have your tried changing it to $("#PA2Load").on("click", "#pa2dob", function () { ... } instead of $("#PA2").on("click", "#pa2dob", function () { ... }?
 
9:29 PM
buddy i've a temporary link can u please check 3e464737.ngrok.com
no it's not working
 
Instead of binding $('#pa2dob').Zebra_DatePicker({...}); after $("#PA2").on("click", "#pa2dob", function (), try binding it in function procRisk() after you load <div id="PA2Load">. That way it does not wait until after a click, but is bound immediately
 
Let's try
 
10:01 PM
unable to succes
succed
 
Well I am out of ideas. I have to leave to get some work done. Good luck.
 

  last day (15 days later) »