I want an input text box that restricts users to only enter numbers and one decimal point. The regular expression I am using currently is /[^d.]/g. Currently this allows the user to only input numbers and decimals but also allows for more than one decimal number. I am using it for a text box to allow only a s…
Tab selection without jQuery
I have a function in jQuery to switch tabs and as it the only one using jQuery, I want to convert it to JS only. After hours of trying (still learning) and feeling miserable to fail at this trivial thing, I humbly ask for help. I was about here when I gave up, my forEach/event listener won’t even work a…
paging and search with ajax and partial view in asp.net core
I’m using .net core 6 and I have a table that has pagination and if the table page changes, it refreshes the page I want to change the table page without refresh using partialview and Ajax controller: userService: View: Can you tell me how to do this? Thankyou Answer Could you show your codes about part…
Change var value from dropdown in javascript with onchange
I have a dropdown list which looks like this: And my code to get the value is: The value always chooses the first item. How can I get it to accept the cityID and change the page, I’m sure its a formatting or typo or wrong value ? Answer You could achieve this using addEventListener also.
Firebase Functions Finished with status: error
I am writing my first Firebase Function that is supposed to make a collection with a document inside (in Firestore) when a new user registers. The only logs I am getting are the following: Function execution started and Function execution took 194 ms. Finished with status: error. The versions of the dependenc…
Can I have the params with an empty object with getStaticPaths?
In the getStaticPaths function, there is a path returned with params postId:1. If have two or three more params with postId: 2, postId: 3 etc. those will be statically generated. Right? Is there a way not to statically load any post with any id? If I want to load all the posts with the loading screen, is that…
How to re-render react-table in .js when data changes in another .js
I am new to react-table and trying to re-render a react-table when data supplied to it changes. Is there anyway to do so? I have tried using useEffect() with no avail. CLARIFICATION: Usage.js and Updater.js needs to be kept seperated with their functions as shown. I am open to using another approach than glob…
How to transition an element that does not exist on the DOM yet
Now I have code like this as you might have noticed for the code to appear it depends on some state value to be true. My question is how do I get it to appear smoother. I cant transition it because I don’t know the property like background or color or something else. And the content is not hidden for
How to fix React Apex Chart initial mount delay?
I am using React Apex chart library in my project.I’ve figured that the library charts have a small delay before rendering on initial mount. This issue harms the UX because the component that renders ApexCharts won’t be displayed until after the delay. Is there a way to fix this ? Answer I figured…
Javascript media queries not working in safari / iOS
Hope someone can help. The following lines of code work in everything except Safari. Has anyone else discovered how to get Safari to recognise / process these queries? Any and all help gratefully received. Answer Safari does not support resolution, though it looks like the relevant bug has been fixed so it…