Comments (5)
Can you explain the overall experience you're trying to implement? If I understand correctly, you have an input widget for selecting a month and year, and then you want to update a calendar view below the input widget when the date is changed. Is that right?
from intercooler-js.
That's correct. And the code above works. The issue I have is that , on refresh, the default values for the form (today's month and today's year) are not displayed.
In more detail:
- the user select , say,
March
and2020
- press
submit
--> the calendar is correctly updated - then , for whatever reason, the user presses refresh
--> the calendar gets correctly updated with the default values (today's month and today's year)
But the form still showsMarch
and2020
.
What is interesting as well is that the page source shows that the form is correctly initiated with the initial values (today's month and today's year) but the page still displays March
and 2020
.
Does this make sense ?
from intercooler-js.
Yes, that makes sense but I don't think it's related to Intercooler. Check out this gist where I think I captured a UI similar to what you explained: https://gist.github.com/adamstep/186c56500afd05b4179e562b9cbe5b42
When I refresh, I get the same default date in the input and the display below. It sounds like maybe the web browser is remembering the previous input. Which browser are you using to test?
from intercooler-js.
I see, thank you for testing!
I am using Firefox. Would you know a way I could prevent that from happening ?
Also I may not be testing correctly but I cleared cache & cookies on Firefox, subsequently refreshed the page but the wrong date persist (March
and 2020
in my example above).
Then again I tested the behaviour of the code on safari and I do not have that problem: on refresh, the default values for the dates are correctly displayed.
from intercooler-js.
turns out it's a Firefox-specific issue. This helped: https://stackoverflow.com/questions/4831848/firefox-ignores-option-selected-selected
I added an id to my form and :
window.onload = function() { document.forms['date_form'].reset(); };
to my js and all is well.
Thank you for your help Adam !
from intercooler-js.
Related Issues (20)
- simple Django - Intercooler.js example on how to pass a django variable to a view HOT 2
- It appears the google group is gone HOT 4
- IC potential clash with jquery ? HOT 2
- Set history and new URL after ic-get-from? HOT 3
- Suggest clarification on `ic-target` HOT 1
- How get and populate different targets with a single POST request HOT 3
- Can ic-get-from include value of triggered input? HOT 2
- Prepend element before a target and remove element afterwards HOT 5
- Query string keeps getting bigger ic-get-from / ic-current-url HOT 1
- Preventing default for a button inside a form HOT 4
- ic-push-params: multiple GET parameters with same name cannot be pushed to URL HOT 1
- Intercooler.ready is executed on document.ready HOT 9
- Elements with SSE trigger do not get cleaned up when swapped out of the DOM HOT 6
- ic-action does not support chained derefences HOT 5
- New add-object form includes a dependent select HOT 2
- document bootstrap version on example(s)
- intercooler-1.1.1.min.js offline HOT 3
- ic-trigger-from not working on form with ic-post-to HOT 1
- Extending the functionality of Intercooler to other controls
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intercooler-js.