Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by funbinod

  1. i'm using jquery version 2.1.0 jquery api said live is deprecated. using on event handler also did nothing. console log shows nothing.. and yes! .live() event worked after migrating jquery to version 1.2.1 . but I don't want, if there is other option, to migrate to older version
  2. $n = 0; while ($qr = $qq->fetch_assoc()) { $n++; <a class="email" id="email'.$n.'">'.$aemail.'</a>;} <script> $("#email<?php echo $n; ?>").click(function(e) { $("body").append("<div id=pop><div id=popin><br /><br /><input id=emaill type=text value='<?php echo $aemail; ?>' /><br /><br /><input type=button id='close' value=CLOSE /></div></div>"); $("#popin").effect("slide", {easing:"easeInOutElastic"},3000); $("#emaill").focus(); }); </script> the javascript inside while l
  3. using 'id' yes for emails on all rows. using 'class' no....
  4. thank u for the reply I tried "$(this).remove()" also. but it didn't work either.. and yes I've attached this event after I append the div..
  5. if I use "id" it selects email from first row and if I use "class" it selects all emails from all row and appends popup div for all rows... and I wish one by one selection...
  6. I was trying to get a popup div on click handler. $("#email").click(function(e) { $("body").append("<div id=pop><div id=popin><br /><br /><input id=emaill type=text value='<?php echo $aemail; ?>' /><br /><br /><input type=button id='close' value=CLOSE /></div></div>"); $("#popin").effect("slide", {easing:"easeInOutElastic"},3000); $("#emaill").focus(); }); but I failed to remove (or close) that div on another click handler.. the following is what I tried to close that div... $('#pop').click(function(e) {
  7. i'm doing this. but the problem is that I want the email address on a "div" on the "same page" that is appended on click event, not on a "new popup window". I know how to use "data attribute on the anchor tag" to a new window, as u suggested. but I don't know how to do that on the same page.. will u please guide me to this...???
  8. thank u for the quick reply. I've tried using class also. but its not working either... edit: moreover using class opens popup div for all the emails...
  9. I have columns from some rows of a MySQL table using php. while ($qr = $qq->fetch_assoc()) { echo '<a id="email">'.$qr['email'].'</a>';} there are multiple rows. but when I click and any of the derived emails, I want that email to be displayed on the popuped div $("#email").click(function(e) { $("body").append("<div id=pop><div id=popin><br /><br /><input id=emaill type=text value='<?php echo $aemail; ?>' /><br /><br /><input type=button id=close value=CLOSE /></div></div>"); $('#popin').effect('slide', {e
  10. i'm trying jquery autocomplete using following---- <script>$(function() { $( "#icode" ).autocomplete({ source: "icode.php" });});</script> and the icode.php is----- <?phprequire_once('functions.php');$q = strtolower(mysqli_real_escape_string($connect, $_REQUEST["term"]));$return = array();$query = mysqli_query($connect, "SELECT icode, item, sprice, pprice FROM stock WHERE icode LIKE '$q%' AND cid='$cid' ORDER BY icode") or die("Error: ".mysqli_error($connect));while ($row = mysqli_fetch_array($query)) { array_push($return,array('value'=>$row['icode'].':'.$row['item'].':'.$
  11. $stmt->bind_result($icode,$items,$desc,$catid,$unitid,$pprice,$sprice,$oqty,$oprice,$bcode,$oamt);
  12. can u post ur query that u tried? how can anyone suggest u anything without seeing what have u done?
  13. I was retrieving only one row from a table. in localhost it gave good result. but while using online, it says memory size exhausted. perhaps there are different settings on my localhost and webhost regarding memory size. but I wondered that how can the memory be exhausted while retrieving information from only one row? or there is problem in my query?? the following is the query I used. $sql = "SELECT icode,item,description,catid,unitid,pprice,sprice,oqty,oprice,bcode,oamt FROM stock WHERE sid=? AND cid=?";if($stmt = $mysqli->prepare($sql)) { $stmt->bind_param('si', $sid, $cid); $st
  14. uhh uhh uhh uhh!!!!!!!! thanks for the suggestion.
  15. what I want to do is just to make this work. I did this coz I know this. if I get chance to learn more efficient method, surely i'll change the code. will u guide me to there???
  16. oh yes! thank u! I understood what u pointed. but I didn't what u suggested (coz I know less on using class). but I made one logic and solved it. I generated an unique id for each row and attached it to the 'id' and modified the jquery with respect to it. below is what I did----- $rn = 0;while ($row = ...................) { $rn++; echo " <tr> <td>".$row['abc']."</td> <td><a id='delete".$rn."' href='delete.php?m=$m&abc=$row[abc]'>DELETE</a></td> <script> $(document).ready(function(e) { $('#
  17. (sorry if I had to ask it on php forum) inside a php while loop can I run jquery (or javascript) for each row??? I tried the following --------------- while ($row = ...................) { echo " <tr> <td>".$row['abc']."</td> <td><a id='delete' href='delete.php?m=$m&abc=$row[abc]'>DELETE</a></td> <script> $(document).ready(function(e) { $('#delete').click(function(e) { var conf = confirm('Sure Delete!?') if (!conf) { event.preventDefault(); } }); }); </sc
  18. ok! I got it now and solved it. I did the mistake. I had placed the initial value of $bal inside the loop. now I placed the initial value of $bal (i.e. $bal = $prebal) before starting a loop. $bal = $prebal;foreach ($period as $month) { ......................; ......................; $bal += ($svalue - $pvalue); echo $bal;} this solved the problem. thank u both for your company....
  19. ok! let me guess and try something. assuming $bal is the rightmost column $bal = $prebal // this assumes the first ever row starts with some value calculated previously$bal += $svalue - $pvalue // preceding columnsecho $bal; is this the method you suggested me? but this calculated value for each row only. like, $prebal + $svalue - $pvalue. it didn't continued adding to further rows.
  20. understood nothing on the link that can guide me through what I wish.. I understand of "having a set of variables to keep track of whatever I want" as u suggested. but my problem is for calculation using the value derived from the calculation between the values of previous row....
  21. solved! thank u. now will u take me more deeper? I wonder if there is some method of calculation between arrays!! meaning, I want to calculate value(s) of this row with the value of previous row. below is the example.. while ($row = ....................) { $ttl = ($row['a']+$row['b']-$row['c']); echo $row['a'] . ' | ' . $row ['b'] . ' | ' . $row['c'] . ' | ' . $ttl . '<br />';} but after each row I wish the value of $ttl on each rows be calculated in respect with the previous row.. lets look with practical example... lets assume some data derived from above query...
  22. how can I print php arrays as we print sql arrays using while loop.? print_r ( ) returns array as Array ([1] => A [2] => B [3] => C [4] => D [5] => E) But I wish to print as A B C D E That we get using sql query like... while {$row = mysqli_fetch_array($query) { ................... .................. }
  23. that's why I've mentioned ".......... depends on .... overall design, where and how u wish blank lines or spaces..........."
  24. is using double quotes in HTML is a problem that they should be escaped?? sorry I've less idea about this...
  • Create New...