Jump to content

funbinod

Members
  • Content Count

    499
  • Joined

  • Last visited

Everything posted by funbinod

  1. funbinod

    summing results

    I've a query that gets some rows with some results. and I want to sum all the results like I get $balance from a query while ($r = $q->fetch_array) { echo $balance.'<br />';} and when I get the rows with $balance, I want to sum all of them and display at the bottom I tried, $total = 0;while ($r = $q->fetch_array) { $total = $balance++; echo $balance.'<br /';}echo $total; but its not giving the required result. please guide. thanks in advance....
  2. funbinod

    mysql timezones

    I want to know how can I set timezone for MySQL from phpmyadmin? I tried set time_zone = 'Asia/Kathmandu'; and it said unknown timezone. I checked the supported timezone list, and it contains my timezone. then I tried set time_zone = '+5:45'; and it succeeded. but when a row is updated, the timestamp column is not storing the correct time according to my timezone. please guide what is the problem??? thankz in advance....
  3. oh thank u. now I changed the id for both options to 1 and 2 and now I changed the jquery selector by its name... $('#dname').keypress(function(e) { if (e.which === 13) { if ($('input[name=by]').val()=='CHQ') { $('#cqd').select(); } else if ($('input[name=by]').val()=='CASH') { $('#ref').select(); } } }); selecting by its name also not doing the proper job . what do u suggest me to make this done...????
  4. BY: <input type="radio" name='by' id='by' value="CASH" checked />CASH | <input type="radio" name='by' id='by' value="CHQ" />CHEQUE sorry! I might have been misunderstood... please guide how can I have options for radio buttons for one question???
  5. I've some problem executing some line with different condition on radio button selection... $('#dname').keypress(function(e) { if (e.which === 13) { if ($('#by').val()=='CASH') { $('#cqd').select(); } else if ($('#by').val()=='CHQ') { $('#ref').select(); } } }); in this code #by is radio button with two options - val='CASH' & val='CHQ'. on 'keypress', if CASH is selected '#cqd' should be selected and if CHQ is selected '#ref' should be selected. but this only the #cqd is selected in both conditions. please guide me to execute it properly. thanks in advance...
  6. funbinod

    max-width

    max-width not working on the following. <table style="padding:0; border:none; border-spacing:0; max-width:98%; min-width:1000px; margin-left:auto; margin-right:auto;"> the table width is fixed on min-width though the screen resolution or width is more than that. shouldn't it be set on max-width if the page width is more than min-width????
  7. ok I've done this $('#name').keyup(function(e) { getAid(); // this is the function for ajax request $('#address').attr('disabled', 'disabled'); if (e.which === 13) { if( ($('#aid').val() !== '')) { e.preventDefault(); $('#address').removeAttr('disabled'); $('#address').focus(); } else { alert('Error!'); $('#name').select(); } } }); please guide me where I've done mistake. everything seems to be working fine but the focus goes to #address whether the ajax is successful or not...
  8. hi guys! greetings! I've used ajax to get some data after user inputs some information on a <input> and hits enter. function getAid(){var XMLHttpRequestObject = false;if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest();} else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp");}XMLHttpRequestObject.onreadystatechange = function(){ if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { document.getElementById('aid').value = XMLHttpRequestObject.responseText; }}var name = encodeURIComponent(
  9. funbinod

    round always up

    uh ha! that's great! thank u!
  10. funbinod

    round always up

    hey guys! how can I always round up a number in php? I learnt about ROUND_HALF_UP, ROUND_HALF_DOWN, and others. but what can I do if I want to round a number always up whether it is greater than half or less than. for example 12345.01 = 12346 12345.99 = 12346 please guide me. thanks in advance....
  11. hey guys! I diagnosed that the all problem is about jquery support for ".click()" and ".on()" event handlers. I am using jquery-2.1.0. but its not supporting these events. then I migrated it to 1.2.1 and used ".live()" event and everything worked. please suggest me which event is used for this on jquery-2.1.0???
  12. $('#sendmail').submit(function(e) { e.preventDefault(); yes! they are after I clicked the submit button..
  13. thank u. I corrected it and its now working as I wanted...
  14. event also not working attached are the screenshots of developer tool (console and network)
  15. not working :( :'( $('#sendmail').submit(function(e) { event.preventDefault(); $("#sendmail").validate(); if ($("#sendmail").valid()) { $.ajax({ type: "POST", url: "sendmail.php", cache: false, contentType: "application/json; charset=utf-8", data: { msg: $('#msg').val(), subj: $('#sub').val(), emaill: $('#emaill').val() }, dataType: "json", complete: function(transport) { if (transport.status == 200) { alert('Mail Sent Successfully!');
  16. thank u. that's a good point.. but I need to change some other properties also. and there is still some problem, I think. please refer to http://jsfiddle.net/zuv455oh/4/ again...
  17. yes! you caught the point. it is reloading the page in stead sending ajax request (page load animated icon on the address starts running after I click send button). I tried to stop the form submit using "e.preventDefault()", "e.preventDefault()", "return false" but its not stopping the submission. is this method wrong? any other idea???
  18. yes it does! to test it I've added some line after execution of php mail() if (mail($to, $subject, $body, $from)) { $_SESSION['msg'] = 'mail sent successfully to "'.$to.'"';} else { $_SESSION['msg'] = 'mail sent failed to "'.$to.'"';}die(header('location: notes.php'));////// this part is only to test if the script is working or not. for ajax script to execute I only use "mail($to, $subject, $body, $from)" /////// yes! there is no any alert on any response status. neither any email... if (transport.status == 200) { alert("Mail Sent Successfully!"); } else
  19. I was trying something idiot. I created 4 divs and arranged them to look like some object. and I wish them to slide away to right at once so that it looks like the displayed object moved.. the effect is make on click event. I tried sliding wrapping div but it slid only first div and others disappeared. then i tried moving individual divs also. but it moved individually not at once as one object... please refer to this jsfiddle http://jsfiddle.net/zuv455oh/3/ and guide me to better solution... thank u in advance...
  20. the status is ok at developer tool. it says "Status - 200 OK" there I found one mistake (additional extra closing curly brace). I fixed it. but still no response. one additional point-- I am trying to send mail from a appended div after clicking the email address... following is the complete code... $('#send').click(function(e) { $("#sendmail").validate(); if ($("#sendmail").valid()) { $.ajax({ type: "POST", url: "sendmail.php", cache: false, contentType: "application/json; charset=utf-8", d
  21. oh right! I forgot the comma. but its still not working. I don't know what happened. but its not showing alert that were intended after success or error....
  22. thank u now the script became $.ajax({ type: "POST", url: "sendmail.php", cache: false, contentType: "application/json; charset=utf-8", data: { msg: $('#msg').val(), subj: $('#sub').val(), emaill: $('#emaill').val() } dataType: "json", complete: function(transport) { if (transport.status == 200) { alert('Mail Sent Successfully!'); } else { alert("Please try again later!");
  23. thank u for the reply. but sorry, I don't know what that really means. does it mean data: $("#msg").val(), data: $("#emaill").val(), ?????????
  24. i'm trying to make a mail form using ajax. but getting some problem. please guide following is what I tried... html <form id='sendmail' method='POST' action='sendmail.php'> <input id='emaill' name='emaill' type=text value='<?php echo $aemail; ?>' /><br /><br /> <textarea cols='20' rows='10' id='msg' name='msg'></textarea><br /><br /> <input type=submit id='send' value=SEND /></form> jquery $('#send').live('click', function() { $("#sendmail").validate(); if ($("#sendmail").valid()) { $.ajax({
  25. <script>$(document).ready(function(e) { $('#close').on('click', function() { $("#pop").hide("slide", {easing:"easeOutElastic"},1000); });});</script>
×
×
  • Create New...