Categories
Mastering Development

How to fix onclick Function is not working using JavaScript

Anyone can help me? this is my problem. When I tried to click the button using this function $(“.btn_cellophane”).on(“click”,function(){}); I did not get any response or even the error. I guess the onclick function is not working. Here’s my code below. METHOD CALLING $(“.btn_cellophane”).on(“click”,function(){ alert(“Tester true”); if($(this).hasClass(“btn-warning”)){ $(this).removeClass(“btn-warning”); $(this).addClass(“btn-success”); // add_amount_for_cellophane(); }else if($(this).hasClass(“btn-success”)){ $(this).addClass(“btn-warning”); $(this).removeClass(“btn-success”); […]

Categories
Mastering Development

Trying to print fetched data and move the element into another array on click of each button

Question : Create a PLP and PDP page with 20 products of 4 different categories (Electronics, Clothes, Appliances, Accessories) with unique SKU ID. The Quantity limiter should be between 1 to 1000. Add to Cart must add the product to the cart below (display it as a table with delete option). Pagination must be present. […]

Categories
CMS Development Wordpress

Search not filtering the user meta checkbox values create by ACF [closed]

I am working on a custom search filter which is filter users by user meta. All the user field were create by Advance Custom field. I am trying to filter users by checkbox values which user select from there profile. but some how data is not filtering. I even tried custom php queries to pull […]

Categories
CMS Development Wordpress

Filter WP user acf field by ajax

I have a search page where search result of user is displaying by postal code or county name. while on the search page i have checkbox to filter user by attribute like developer, designer, and account, so visitor can filter the user of the postal code by attribute. All the field was create by advance […]

Categories
CMS Development Wordpress

Bad Request in AJAX

I am working in a WordPress plugin. I need help in below AJAX code. // On change division $(‘body’).on( ‘change’, ‘.division’, function() { $.ajax({ type: “POST”, url:localData.statesurl, //http://localhost/wordpress/wp-admin/admin-ajax.php data:{ division: $(this).val(), // I am getting value here. action: ‘division_to_district_ajax’ //Do you need anything here ? }, success:function(rss){ console.log(rss); $(‘.district’).empty(); var $opt = ”; $.each( JSON.parse(rss), […]

Categories
Development

Refreshing PHP file through jQuery in chrome extension

I am trying to make a chrome extension that takes data from my PHP file and displays it, it shows data correctly but whenever i do changes in my PHP file it does not show it in the extension i have to open localhost and reload PHP file every time to see changes in extension. […]

Categories
Development

No State appeared after country Selection in Laravel

As I select the country the State Select Option doesn’t appear and there are no states to select cities. Here’s some text because stackoverflow is not allowing the below text because if too much code. It is still not allowing me because of it so here’s some more text. AddressController use App\Country; use App\State; use […]

Categories
Development

php dependent drop down list overpopulating

this problem may be asked already somewhere but what i found around here didn’t help, so please help me out. I created a dependent drop down list for a Product(have the product names listed)/Bundle(numerical values depending on selected product) example using php,mysqli and js but my problem is that the Bundle list gets me all […]

Categories
Development

JS parse string always as string and no number evaluation

Example: var garbage = JSON.parse(‘12345E666’); => infinity while var garbage = JSON.parse(‘1234E300’); => 1.234e+303 As you can see, this is rather rotten and definitely not what I want. The task at hand is to receive a string … and it should remain as such. I have looked at JSON.stringify already, but this is also not […]

Categories
Development

how do i make the option selected in append jquery in foreach

How can I make the option selected according to the value I get from value[0] in the loop? $.each(data, function(key, value) { $(“#cektubuh”).append( `<tr> <td> <select name=”duration_type[]” class=”form-control” required> // here I want to add the selected option according to $ {value [0]} <option value=”Semester”>Semester</option> <option value=”Month”>Month</option> </select> </td> </tr>` }); });