4

I'm pretty new to Django (and web development) and find myself struggling with this problem. I'm able to pass the data from Django to javascript HTML

 function load_led(){
    {% for leds in led %}

        var str2 = "{{leds.name}}"
        var x = {{leds.x}}
        var y = {{leds.y}}
        var w = 30
        var h = 30
        var fill = "{{leds.color}}"

        document.getElementById("FirstName").value = str2;
        document.getElementById("xposition").value = x;
        document.getElementById("yposition").value = y;
        document.getElementById("status").value = fill;

        add1(x,y,fill);
    {% endfor %} 
} 

Now I change the values of Elements and then want to pass this values again to Django so that I can update my database. So how can I pass the values from javascript or from HTML page

1

1 Answer 1

1

You need to make an ajax call or similar to pass data to the server. You can make it very fast with jquery

Sign up to request clarification or add additional context in comments.

2 Comments

Can you please explain with the example or can you please post the link of sample example in which ajax is explained ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.