Jump to content

funbinod

Members
  • Posts

    501
  • Joined

  • Last visited

Everything posted by funbinod

  1. its logging nothing... just showing "Uncaught TypeError................"
  2. u r right. i appreciate ur guidance so far and this suggestion. but since i'm beginner i know less. if u guide me through the process it would itself make me do it myself next time (on other relative processes also). so i expect ur kindly appearance till this problem is solved. i think this is what u expected to know for the value assigned for this. (or i'm not sure)... $('form').on('submit', function (e) { e.preventDefault(); var form = this; confirmDialog('Confirm', 'Are you sure?', function () { form.submit(); }); });
  3. on line 87 buttons: { Yes: function () { console.log("The function is running", success); success(); $(this).dialog("close"); }, No: function () { $(this).dialog("close"); } }, close: function() { $(this).remove(); // line 87
  4. The function is running function () {form.submit(); }Uncaught TypeError: object is not a function
  5. i did that. but the problem remained same...
  6. the following script to ask for confirmation before submitting a form is not working while clicking yes. please guide me find the error... <script>$(function () { 'use strict'; function confirmDialog(title, message, success) { var confirmdialog = $('<div></div>').appendTo('body') .html('<div><h6>' + message + '</h6></div>') .dialog({ modal: true, title: title, zIndex: 10000, autoOpen: false, width: 'auto', resizable: false, buttons: { Yes: function () { success(); $(this).dialog("close"); }, No: function () { $(this).dialog("close"); } }, close: function() { $(this).remove(); } }); return confirmdialog.dialog("open"); } $('form').on('submit', function (e) { e.preventDefault(); var form = this; confirmDialog('Confirm', 'Are you sure?', function () { form.submit(); }); });});</script>
  7. wow! that's great. i didn't notice that. thank u very much....
  8. i was trying to get some value according to value entered to form <input> field. but it returns value only to another <input> field but not to <div>s or <span>s. i wonder what is the problem. here is what i tried // this is ajax script // get cqtyfunction getCqty(){var XMLHttpRequestObject;// ...............// ...............if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { document.getElementById('cqty').value = XMLHttpRequestObject.responseText;}}var icode = document.getElementById('icode').value;XMLHttpRequestObject.open('POST', 'ajax/cqty.php');XMLHttpRequestObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");XMLHttpRequestObject.send("icode=" + icode);} // this is cqty.php <?require_once('../functions.php');header("content-type: text/xml");$icode = trim($_POST['icode']);$sql = mysqli_fetch_object(mysqli_query($connect, "select * from stock where icode='$icode'")) or die(mysqli_error($connect));$item = $sql->item;$unit = $sql->iunit;$sid = $sql->sid;$oqty = $sql->oqty;$sql1 = mysqli_fetch_array(mysqli_query($connect, "select sum(pqty),sum(sqty) from tran where sid=$sid")) or die(mysqli_error($connect));$pqty = $sql1['sum(pqty)'];$sqty = $sql1['sum(sqty)'];$cqty = $oqty + $pqty - $sqty;echo "( " . $cqty . " " . $unit . " )";?> and this is client side <tr> <td align="right">Item Code: </td> <td> <input type="text" name="icode" id="icode" onkeypress='return tabE(this,event)' onchange="getRate();getItem();getCqty()" /> </td></tr><tr> <td align="right" width="100px">Item Name:</td> <td> <input name="item" id="item" onkeypress='return tabE(this,event)' /><!-- value returns fine here. but if i used <div> or <span> in stead of <input>, nothing is displayed--> </td></tr> can anyone please help me find out the problem...
  9. i even tried that but it didnt do what i(and u too) expected. dunno what is the problem. and i could not even understand what @justsomeguy is pointing me towards. sorry! but now i changed my autosuggest script like this and it worked... <?php$sql = mysqli_query($connect, "select * from stock order by item") or die(mysqli_error($connect));while ($row = mysqli_fetch_assoc($sql)) { $items[] = $row['item'];}$namesql1 = mysqli_query($connect, "select * from account order by name") or die(mysqli_error($connect));while ($namerow1 = mysqli_fetch_assoc($namesql1)) { $name[] = $namerow1['name'];}?><script type="text/javascript" src="jquery-2.1.0.js"></script><script src="jquery-ui-autocomplete.js"></script><script type="text/javascript">$(function() { var items = <?php echo json_encode($items); ?>; $("#item").autocomplete({ source: items }); var name = <?php echo json_encode($name); ?>; $("#name").autocomplete({ source: name });});</script></head><body onload="document.getElementById('name').focus()"><input name='name' id='name' onkeypress='return tabE(this,event)'><input name="item" id="item" onkeypress='return tabE(this,event)' /> thank u for ur company...
  10. ok! i'll try to find out that. but while i search for that, can we discuss on another question above. why the "enter" key not moving to <select> field from <input>? while it is moving from <input> to <input>. and using "tab" key moves everywhere...
  11. i was using simple ajax method to getData stored on 'items.php' and insert it on the "<td id='items'> </td>" i've this already in my page. <td id="item"><script>getData("items.php", "item")</script></td> it displays everything fine. i wish to add this same line again. but when i .append this element it doesn't work..
  12. uh huh! ok! i got it. but i dunno if it has done as what u explained or not coz i found this plugin on the web.. and i wonder if (or though) it has replaced <select> element with <input> why the "id" is not working (like for CSS & body onLoad)? and if i manually change <select> as <input> everything work fine - "enter as tab", CSS, <body onLoad) -- all work... here is the jquery i used for data sorting <script type="text/javascript" src="jquery-2.1.0.js"></script> <script src="jquery.js"></script> <script src="jquery-ui-autocomplete.js"></script> <script src="jquery.select-to-autocomplete.min.js"></script> <script type="text/javascript" charset="utf-8"> (function($){ $(function(){ $('select').selectToAutocomplete();// $('form').submit(function(){// alert( $(this).serialize() );// return false;// }); }); })(jQuery); </script>
  13. ok! i got the array first but how can i put that inside "<td></td>"
  14. thanks for the reply. but sorry! i couldn't understand what u replied
  15. i was trying to replace enter key with the 'tab' function. but it returned strange error. it is working for all <input> elements but not working for <select> elements. along with this, CSS and <body onLoad ...... focus()> also are not recognizing it with its "id". but when i change <select> to <input>, everything work fine... one thing more -- <select> element contains php array value and is configured with jquery for autocomplete.... below is what i tried--- <script type="text/javascript"> function tabE(obj,e){ var e=(typeof event!='undefined')?window.event:e;// IE : Moz if(e.keyCode==13){ var ele = document.forms[0].elements; for(var i=0;i<ele.length;i++){ var q=(i==ele.length-1)?0:i+1;// if last element : if any other if(obj==ele[i]){ele[q].focus();break} } return false; } } </script> </head><body><input name='ref' type='text' id='ref' onkeypress='return tabE(this,event)' /><input name='date' type='text' id='date' onkeypress='return tabE(this,event)' value='".date('Y-m-d')."' style='text-align:right' /><select name='name' id='name' autofocus autocorrect='off' autocomplete='off' onkeypress='return tabE(this,event)'><option value='' selected='selected'></option><?php// ........................while ($row = mysqli_fetch_array($result)) { echo "<option>" . $row['name'] . "</option>"; }?></select>
  16. i am trying to create new element that contains a php returned array in it. $( "#invoice" ).append( '<td id="item"><script>getData("items.php", "item")</script></td>'); the array is returned from 'items.php' and is called with simple ajax technique. its not working, or simply i don't know how can i do that. can anyone please guide me or suggest me some better technique...?
  17. its still not working. it still tries to open "javascript:void(null)"
  18. then what could have happened to my IE-11? it tries to open javascript:getData('note.php?', 'note')
  19. i'm learning ajax along with javascript. while learning i'm trying something as responseText. what i tried works fine on CHROME version 36(dev) but doesn't work on Internet Explorer version 11. this is what i tried <head><script type="text/javascript">var XMLHttpRequestObject = false;if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest();} else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp");}function getData(dataSource, divID){ if(XMLHttpRequestObject) { var obj = document.getElementById(divID); XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { obj.innerHTML = XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.send(null); }}</script></head><body><table><tr><td><a id="note" href="javascript:getData('note.php?', 'note')" class="link">Note</a></td><td id="note"></td></tr></table> please help me find what i missed........
  20. i'm trying to learn jquery. while learning i'm trying autosuggest and i tried this <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("item.php", {queryString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 200); }</script> it is working properly... but i wish the suggestion could be selected using up and down arrows on keyboard. can anyone suggest how can i do that?
  21. you should post a new topic. dont ask any question on any other topic....
  22. there is no reason not to believe u. i'm nothing in comparison to a php tycoon like u. i was just asking for other possible reasons for it. and now i found it. shame on me. i just forgot to place method="post" into the form. thank u for ur company.
  23. its again something different @Ingolme, i think. the referer page that i want to redirect back to is not a success page. its the page from where i reached to the edit page and i want to redirect back to the same page after editing the information including success messege.... this is the chain (or cycle) ===> report.php => edit.php => editpost.php => report.php (with success messege) customer.php => edit.php => editpost.php => customer.php (with success messege) in this way won't the action checking code give error when i visit the page before i redirect through editpost.php?
  24. i just wish to display the "success messege" just above the "redirected page" and can't i retrieve referrer page just as file name? not as full address including document root? like http referer gives "http://localhost/referer.php?" but can i get just "referer.php"? it will be helpful if i use different server for different users.....
×
×
  • Create New...