AJAX function is not getting the id

I am trying to fix this problem for about 3 days and can not do it. I need to take the id from which is auto incremented in the Django. Can you guys help me please. function add_product(){ event.preventDefault(); var name = $("#name").val(); v...
more »

2017-11-11 01:11 (1) Answers

jQuery + MVC pass string to controller

I'm trying to do something I would think is fairly simple, but I must be missing the syntax. function removeFile(filename) { var json = { "fileName": filename }; $.ajax({ type: 'post', url: "home/RemoveFile", dataType...
more »

2017-11-10 18:11 (2) Answers

PHP validator getting 0 from AJAX

Essentially, I'm trying to send an email to a PHP script to check for availability using ajax and an onKeyUp event in HTML. So far I've tried about everything I can think of doing for the past several hours trying to troubleshoot this issue to no av...
more »

2017-11-10 14:11 (1) Answers

Behaviour of last elements in grid

I have got a bootstrap grid with dynamically generated images. If the last element is alone in the row it should be centered. And if there are two elements in row, the second element should float right. This is what I want: Two elements in row: A...
more »

2017-11-10 11:11 (4) Answers

Asp.net Fileupload img preview

I' have 5 fileupload control in a form. I want to preview selected img. I can do it for one fileupload but for 5 control I had to change function like below <div ><asp:FileUpload ID="FileUpload1" runat="server" Width="100%" nchange="read...
more »

2017-11-10 10:11 (1) Answers

Materialize autocomplete ajax

I'm using the materialize autocomplete plugin to create multiple tags input with autocomplete. Plugin works fine, yet only with data passed as an array defined in advance. If data is passed from ajax call, plugin does not show dropdown with options a...
more »

2017-11-10 08:11 (1) Answers

Disable submit button between two time period

I need to disable submit button from 10.25 am to 11.25 am. This is the submit button below: <input type="submit" id="submit" name="submit"> I am using this script. but it is not working.I am unable to find out where the problem is: <scri...
more »

2017-11-10 06:11 (4) Answers

import Json to html (table)

im trying to import a json url to html in a table. The problem is when i get the data i get 25 rows i get this on the web console: Object { data: Array[25], paging: Object } I also have the following code which is designed for only one row i guess...
more »

2017-11-10 02:11 (2) Answers

How to use 'or' condition in method of jQuery?

Assume that I have following code. Code 01 $("#abc").click(function(){ //My Code }); Code 02 $("#def").change(function(){ //My Code }); I have to run same code #abc click or #def change. So currently I have wasting time writing same co...
more »

2017-11-09 07:11 (5) Answers

Two functions on button clicks

function myFunction() { document.getElementById("tt").style.marginTop = "50px"; document.getElementById("tt").style.marginTop = "80px"; } <div class="switcher" style="margin-top: 30px;background-color: #430000;width: 300px;height: 30...
more »

2017-11-09 01:11 (4) Answers

Bookmarklet issue

I'm trying to get this bookmarklet running but I get this error (in Chrome): Uncaught SyntaxError: Unexpected identifier I don't get what's wrong with my JavaScript code in the href. I can't put it in a separate file; I need to get this running...
more »

2017-11-08 19:11 (2) Answers

get content of some tags inside a variable

var a = $('#txta').val(); console.log(a); result is complete html code from this url Now I want to get content of all #artikal-naziv tags (there are 96) var b = a.find("#artikal-naziv").text(); console.log(b); Result: Uncaught TypeError: a.f...
more »

2017-11-08 14:11 (5) Answers