w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Use Jquery/Auto Complete in Javascript popup window
You will always encounter this with generated HTML, as JS handlers are applied on page load, and obviously that HTML doesn't exist at that time. What you can do is take advantage of the way JS "bubbles" down the HTML hierachy. I'm guessing you're loading the popup into a html of some-kind that does exist on page load, maybe an empty <div id="mypopup"></div> If so, you can just apply the JS to this using jQuery On Method to that element, as it's there to begin with.

Categories : Jquery

Google Places Autocomplete with Jquery Mobile not working on mobile/touch device
After much hair pulling I have found the problem to be the "FastClick" library I added to my project. As @Saravanan Shanmugam points out in this comment http://stackoverflow.com/a/16932543/1177832 FastClick seems to interfere with autocomplete. Also see above link for the workaround he has added to get the two to play nice.

Categories : Jquery

auto-complete for two text fields jquery mobile
Can you try with below code: $(function() { $("#customer").keyup(function(event) { if(document.getElementById("customer").value == "") $( "#store" ).prop( 'disabled', true ); }); $('#customer').autocomplete({ source: "./SearchCustomer.php?term="+document.getElementById("customer").value, minLength: 0, focus: function( event, ui ) { $( "#customer" ).val( ui.item.label ); return false; }, select: function (event, ui) { $( "#customer" ).val( ui.item.label ); $( "#customer-id" ).val( ui.item.value ); $("#store").removeAttr("disabled").focus(); return false; } }) .each(function() { $(this).data( "ui-autocomplete" )._renderIte

Categories : Jquery

Enlarge Auto-complete Text Box JQuery Mobile
I think this is what you're after - <div data-role="page" id="page1"> <div data-role="content"> <div style='font-size:18px;padding-bottom:15px;'>Customer:</div> <ul id="autocomplete_customer" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="Find a customer..." data-filter-theme="d"> <li><a href="acura.html">Acura</a></li> <li><a href="audi.html">Audi</a></li> <li><a href="bmw.html">BMW</a></li> </ul> </div> </div> $(function () { $('form input[data-type="search"]').css('height', '75px'); }); jsFiddle Demo Here

Categories : HTML

Call PHP Script from Auto-complete AJAX JQuery Mobile
You need to prepare a json object to send from your PHP file. Take a look at json_encode(). Ideally, you would prepare an associative array and then convert it to a JSON For example $arr = array(); $arr['name'] = 'PHP'; echo json_encode($arr); Output { 'name' : 'PHP' } You can then refer to the name in your JS as .then(function(resp) { console.log(resp.name); } This will output PHP in the console. However, you might be better off using jQuery UI's built in Autocomplete. Please refer to this post. Moreover, your code is vulnerable to SQL injections. You should switch to Prepared Statements to avoid this. UPDATE : As for your second issue, you can first assign a class to the list items, eg <li class="autocomp-data"> and then bind a click handler to it. $ul.html( ht

Categories : PHP

jQuery Mobile popup is not opening on .popup('open')
That's because when pageinit is fired, the poupup isnt ready for manipulation just yet. You need to use pageshow to get the popup to open. Here's what you do : Make the ajax call in pageinit. store the data in data attribute of the page. Then, in the pageshow event, take if from data and manipulate it the way you want, then open the popup. Here's the code : $(document).on({ "pageinit": function () { alert("pageinit"); //$("#popupBasic").popup('open'); will throw error here because the page is not ready yet //simulate ajax call here //data recieved from ajax - might be an array, anything var a = Math.random(); //use this to transfer data betwene events $(this).data("fromAjax", a); }, //open popup here "pageshow": f

Categories : Javascript

How to avoid "Complete action with" popup with OAuth callbacks from Google?
Perform authentication in a WebView shown directly in your app. Here is short example how you make it load OAuth page, and how you detect when browser tries to redirect to your oauth callback. At this point, just grab token and close login activity or dialog. This way you don't need to register your app to handle scheme or port, since external web browser is not used. webView = findViewById(R.id.wv); webView.setWebViewClient(new WebViewClient(){ final String cb = "http://your_oauth_callback_uri"; @Override public void onPageStarted(WebView view, String url, Bitmap favicon){ if(url.startsWith(cb)) { view.stopLoading(); Uri uri = Uri.parse(url); String token = uri.getQueryParameter("oauth_token"); // TODO do whatever you need with token } }); webView

Categories : Android

jQuery mobile open popup from popup
It seems that chaining popups is not possible. The solution: $( document ).on( "pageinit", function() { $( '.popupParent' ).on({ popupafterclose: function() { setTimeout( function(){ $( '.popupChild' ).popup( 'open' ) }, 100 ); } }); });

Categories : Jquery

Auto complete with datatables jquery search
You can use my plugin for that , take a look at the example : 4'th column Here is the link to the github of my plugin: Yet Another DataTables Column Filter - (yadcf) Here is a code snippet, just set enable_auto_complete: true in relevant columns (in the below code column_number : 3): $(document).ready(function(){ $('#example').dataTable().yadcf([ {column_number : 0}, {column_number : 1, filter_container_id: "external_filter_container"}, {column_number : 2, data:["Yes","No"], filter_default_label: "Select Yes/No"}, {column_number : 3, text_data_delimiter: ",", enable_auto_complete: true}, {column_number : 4, column_data_type: "html", html_data_type: "text", filter_default_label: "Select tag"}]); });

Categories : Jquery

jQuery Auto-complete - Force Selection/Testing
I'm not 100% certain, but I think browsers prohibit this. Your request might turn out to be impossible. If it were possible, a malicious script could gain access to data that users had previously typed into input fields, e.g. credit card numbers or email addresses, using a script just like the one you outlined. This would be a pretty bad security hole. Sorry about that. Perhaps you could get away with just looping through the input values your want to test and calling $('#medID').val(testValueHere) instead?

Categories : Javascript

Jquery UI Auto Complete - CodeIgniter - CSRF + Models + Controllers
I don't think you're filtering the values that are coming back, as you're missing the options in your jQuery Ajax function which tells it what to filter on. See the example here - http://jqueryui.com/autocomplete/#remote-jsonp data: { featureClass: "P", style: "full", maxRows: 12, name_startsWith: request.term }, However, I prefer to send the query to the PHP controller, and filter the values whilst running it against the database. This way, you're only sending back the values you require, and not all values and then filtering.

Categories : PHP

Sending additional parameters from jQuery auto complete to a php page
You would be able to achieve that like this: var additionalDataToServer; $('#tags').autocomplete({ search: function(event, ui) { $('.test ul').empty(); }, source: function( request, response ) { //set any additional data to the request here... for example additionalDataToServer = $('#someInput').val(); request.additionalDataToServer = additionalDataToServer; $.getJSON( '/autoCompleteKnowledgeBase.php', request, function( data, status, xhr ) { response( data ); }); } }).data('autocomplete')._renderItem = function(ul, item) { return $('<li/>') .data('item.autocomplete', item) .append(item.value) .appendTo($('.test ul')); }; In server, request.term is the value typed by user & request.additionalDataToServer is the one which you added.

Categories : PHP

jQuery Auto Complete Return Data - Showing the ID aswell as label
{"id":"1","value":"Stuart Blackett"}{"id":"2","value":"Simon Wilton"} isn't valid JSON. Try not echoing each $user's information separately - instead, build a new array of users and json_encode() that array. Example: foreach($user_search as $user) { $users[] = array( 'id' => $user->user_id, 'value' => $user->user_firstname .' '. $user->user_surname ); } echo json_encode($users);

Categories : PHP

Popup function in jQuery mobile
Just test the 3 radio buttons to see if they are checked, and if so then open them in a new window. JSFiddle var url = new Array('https://www.yahoo.com', 'https://www.google.com', 'https://www.microsoft.com'); $('#btn').click(function () { $('input[type="radio"]').each(function(index) { if ($('#radio-choice-'+(index+1)).is(':checked')) { window.open(url[index]); } }); });

Categories : Jquery

Cannot get a popup to work in jQuery Mobile
Indeed it's a small thing you're missing! =) jQuery 1.3 Mobile Pop-up Docs: ...then create a link with the href set to the id of the popup div, and add the attribute data-rel="popup" to tell the framework to open the popup when the link is tapped. This is a similar markup pattern to the dialog widget. A popup div has to be nested inside the same page as the link. Move the <div id="menu-items"></div> to within the <div id="home" data-role="page"><div> node, then that should be it! Working jsFiddle included. Dialogs are deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0.

Categories : Javascript

Cannot show Popup with jQuery Mobile 1.3.1
Place popup inside <div data-role=page> and that div should be the direct parent of popup div. I placed before <div data-role=content> in the below demo. Demo Dialog should be placed outside <div data-role=page> because they are treated as a page.

Categories : Javascript

Jquery Mobile Select Popup
While you are trying to open a popup on a select menu, it would want you to give some delay before you can open the pop up. So in your code for popup open, set a timeout for say 100ms, and then do popup('open'). See a demo HERE. JavaScript code would look like: $("#message-commands").on("change", function (event, ui) { var value = event.target.value; switch (value) { case "add": setTimeout(function () { $('#both').popup('open'); }, 100); break; } });

Categories : Jquery

jQuery Mobile popup blurred
have you tried to add this to css? .ui-popup { -webkit-transform:translateZ(0) } Someone mentioning similar problem in the follwoing forum http://forum.jquery.com/topic/1-2-popup-picture-gets-blurry-on-my-android-4-0-phone-also-on-the-demo-page

Categories : Javascript

Dialog popup jQuery Mobile
Since the dialog is not part of the content but sits on top of the screen. You would need a way to calculate the total height of your page under the dialog and know the height of the content being displayed. Then you would need to adjust the height on the dialog possibly Pageload and then change the height of the outer div ui-dialog i believe to the height you calculated. It's not an "easy" novice task. Alternately, you may try to set the dialog to auto size to the content. By default though dialogs are much smaller than what you are showing by your red line. You may have a DIV open, or maybe you might have extra code or height in the dialog page. A great way to see what is happening where is to pull up your site in CHROMe and use firebug to find the dialog and try changing the values ma

Categories : Jquery

Auto focus for first element for form in jquery popup
You can use the jQuery focus function. As an example, I focused an input with name attribute "name": $('input[name="name"]').focus(); The HTML5 autofocus will only work in modern browsers, which may be why you're not seeing it

Categories : Jquery

How to complete reset a page in jQuery Mobile after submitting a form
Try using this function - function refreshPage() { jQuery.mobile.changePage(window.location.href, { allowSamePageTransition: true, transition: 'none', reloadPage: true }); } There are some other solutions to this, I found them here on stackoverflow - jQuery Mobile Page refresh mechanism Reload the Same Page Without Blinking on jQuery Mobile Have you considered manually setting your form values back to empty on the page? This may be a more optimal solution.

Categories : Jquery

jquery mobile Popup on pageinit popupinit?
What you need is this code: $("#sendm").on("popupafteropen", function( event, ui ) { $('#adresa').val($('#emailadr').val()); }); It will be executed when popup is opened. Event used here is called popupafteropen and you can find more about it in an official documentation. Working example made form your code: http://jsfiddle.net/Gajotres/Q5KSV/

Categories : Jquery

opening jquery mobile popup on ajaxStart()
First, the short answer: jQuery Mobile only supports one active popup at a time (for now). The documentation says: Note: Chaining of popups not allowed The framework does not currently support chaining of popups so it's not possible to embed a link from one popup to another popup. All links with a data-rel="popup" inside a popup will not do anything at all. I bumped against this issue a few times in the past and had to hack my way around it. The following code is the solution I'm currently using and works quite well so far (with jQuery Mobile 1.3.2): $(document).on("mobileinit", function() { $.widget("mobile.popup", $.mobile.popup, { _trigger: function(type, event, data) { return this._suspended ? undefined : this._super(type, event, data); }

Categories : Javascript

jquery mobile popup, needs two clicks to close
Try changing your calling of the popup from this: //set up some basic options for display $("#wishItemAdded").popup({ dismissible: false }); $("#wishItemAdded").popup({ transition: "fade" }); $("#wishItemAdded").popup("open"); to this: //set up some basic options for display $("#wishItemAdded").popup("open", { dismissible: false, transition: "fade" });

Categories : Jquery

Draggable Non-Modal Popup Jquery Mobile
Intro I hope this is everything you need. Popup can not be closed if surface outside of it is clicked Elements below popup are now accessible Popup is draggable (tested on Firefox, Chrome, Android Chrome) Few more notes. Some of a javascript code used here is not mine, I am talking about a fix used to make it draggable on mobile devices. Unfortunately I can't remember whose solution it is. CSS is used to make page clickable when popup is opened. Overlay div name is combination of popup id and suffix -screen, in this case it is #popupBasic-screen. Working example Working example: http://jsfiddle.net/Gajotres/tMpf7/ Code used HTML : <!DOCTYPE html> <html> <head> <title>jQM Complex Demo</title> <meta http-equiv='Content-Type' con

Categories : Javascript

Ajax not working in a jQuery Mobile popup
There is a typo error you missed the single quotes ' around the url part $('form').submit(function(event) { event.preventDefault(); alert("checkpoint 1"); $.ajax({ type: 'POST', url: 'process_edit.php', data: $(this).serialize(), success: function(data) { //do something } }); alert("checkpoint 2"); });

Categories : Jquery

Google Places API nearby search missing places
For turning geocodes into full street addresses, I'd suggest you try our Reverse Geocoding service. Using the above location coordinates, reverse geocoding returns "410 Charles E Young Drive, UCLA, Los Angeles, CA 90024, USA" Documentation: https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding Example request: http://maps.googleapis.com/maps/api/geocode/json?latlng=34.0715597,-118.4392192&sensor=true_or_false

Categories : Google Maps

Getting jQuery and AngularJS content assist / auto-complete in eclipse for standalone HTML "file"
JSDT is JavaScript Development Tools, it mainly focuses on providing support for js development and by default adds JQuery auto completion support. For html auto completion install HTML Editor plugin for eclipse from marketplace. To do a quick install use "Eclipse Marketplace" option under Help menu in eclipse, Once this is done html and css code completion works. For AngularJs code completion support couldn't find any do share if you find a solution for it.

Categories : Jquery

how to get google style fixed header in mobile (no jquery mobile)
<html> <head> </head> <body> <style> body { margin: 0; padding: 0; } .TOP_TOOLBAR, .BOTTOM_TOOLBAR { height: 50px; width: 100%; position: fixed;background: #ccc;z-index: 10; } .TOP_TOOLBAR { top: 0; } .BOTTOM_TOOLBAR { bottom: 0; } .SCROLLER_FRAME { width: 100%; position: absolute; top: 50px; bottom: 50px; } </style> <div class="TOP_TOOLBAR"> ... toolbar content ... </div> <div class="SCROLLER_FRAME"> <div class="SCROLLER"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sollicitudin molestie

Categories : Jquery

jQuery Mobile Popup position after user has scrolled
Try using data-position-to='body' http://jsfiddle.net/2egjs/ as in <a class="pop" onclick="$.mobile.silentScroll($('.contentBlock'))" href="#popup-2" data-rel="popup" data-position-to="body">Link 2</a>

Categories : Jquery

Reposition jQuery Mobile popup after content change
This partially works for me: $('#MoveFolderPopup').resize(); I did find that when triggering it immediately it didn't work well so I used setTimeout. It doesn't look very pretty though, I'm looking for a better solution.

Categories : Jquery

JQuery-mobile popup scrolling not working on Android
What if you try forcing a height to popup? Seems like Android is not being aware of the popup's size. [data-role="popup"] { position: relative; // the parent container probably needs a position context also. height: 90%; //just not to block the full screen - it is a popup :) overflow-y: scroll; } Worked on my JellyBean Android stock browser, should behave similarly on Phonegap's webview. If the above doesn't work, delete the position: relative and replace the height by a 'real' value (pixels) instead of a relative value.

Categories : Android

Not able to open panel or popup programatically in jQuery Mobile
Popups and dialogs are tricky when it comes to opening them right after a page event occurs. To fix this issue, you need to use setTimeout to open a dialog or a popup. $(document).on('pageinit', function() { setTimeout(function () { $('#new-lump-sum').popup('open'); }, 100); // delay above zero });

Categories : Jquery

Show image inside JQuery Mobile PopUp
If you are using same id for multiple images this may be a issue because id is supposed to be a unique so in your code i notice the id is same for each image will not gonna work try this $index=1; while($FormDataRow = mysql_fetch_array($formDataSQLObj)) { $Imagepath = "Uploaded_Fotos/"; echo "<tr>"; echo "<td>"; ?> <a href="#popupBasic_<?php echo index;?>" data-rel="popup"> <img src="<?php echo $Imagepath.$FormDataRow[16]; ?>" width="100px"/> </a> <div data-role="popup" id="popupBasic_<?php echo index;?>"> <img src="<?php echo $Imagepath.$FormDataRow[16]; ?>" /> </div> <?php echo "</td>"; echo "</tr>"; $index++; }

Categories : PHP

JQuery mobile popup not working when returned with AJAX
The data key you have above is the data you are sending to the PHP script. Therefore to insert a pop-up afterwards you would add it as below. Notice though that you aren't sending anything specific or doing anything with the received msg parameter for now: $.ajax({ url: '/echo/html/', data: { someParam1: 'someValue1', someParam2: 'someValue2', } type: 'POST', success: function (msg) { popupHTML = '<div data-role="content"><a href="#TEST_about" data-role="button" data-rel="popup">Popup</a><div data-role="popup" id="TEST_about" data-theme="d" ><a href="#" data-rel="back" data-role="button" data-theme="d" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a><img src="http://www.illinoisci.c

Categories : Jquery

Google Places bump using jQuery $.post gives error : HTTP/1.1 400 Bad Request
The issue at hand is called CORS. Places API is not designed to be used directly by JavaScript web applications, it is meant to be used by your server side infrastructure. As such, we have not enabled CORS access, and thus your browser rejects the POST.

Categories : Jquery

Google places api returns duplicate places
As an interim solution, could you build an array of found places in your Callback each time and then within the same loop, see if the place has a count of >1, then don't call createMarker if so? Not sure if perfect, but see below: var foundPlaces = []; var found; function callback(results, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { for (var i = 0; i < results.length; i++) { found = 0; foundPlaces.push(results[i].id); for (var j = 0; j < foundPlaces.length; j++) { if (foundPlaces[j] === results[i].id) { found++; console.log(foundPlaces[j], results[i].id); } } if (found < 2) { createMarker(results[i]); } } } } http://jsfiddle.net/2K

Categories : Javascript

find nearby places using Google Places api
I had a similar problem running the tutorial. I changed the code in GooglePlaces.java as follows: /** * Creating http request Factory * */ public static HttpRequestFactory createRequestFactory( final HttpTransport transport) { return transport.createRequestFactory(new HttpRequestInitializer() { public void initialize(HttpRequest request) { JsonObjectParser parser = new JsonObjectParser(new JacksonFactory()); request.setParser(parser); } }); } This seemed to work for me. It seems as though some of the client api's that were used in the tutorial have been deprecated. This code fixed my problem, hope it helps others out in the future.

Categories : Android

How can I prevent a jQuery Mobile popup from closing when clicking on a link?
Baring a better answer, this seems to be the "least-invasive" JQM way to prevent the popup from closing: $(window).on('navigate', function(e, data) { e.preventDefault(); }); still needs tempering as to when to really preventDefault and when to let the event pass.

Categories : Jquery

Create a Button inside a loop with a popup - jQuery Mobile
in html set a new html with the use of jquery mobile linbrary <div data-role="popup" id="popupBasic"> <p>This is a completely basic popup, no options set.<p> </div> in js $('#button' + counter + paramcounter).click(function(){ sendData(escape(parameterarray[cnt2] + $('#textinput' + cnt + cnt2).val())); $( "#popupBasic" ).popup( "open" ) }); reference popup

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.