html disabled button, display error on click - html

If I set button to disabled, and someone clicks it, how can I make it display another div, which contains explanation why its disabled?
I have no clue how to do this, and would realy appreciate some help.
Thank you!

I had a problem like this a while ago. I think the solution was to wrap a div around the button and detect a click on the div, via jquery. Not pretty but gets the job done.

you can make it using javascript onClick event.
There are many ways to do that. You can create an element using document.createElement and a text node using document.createTextNode to create your own message panel.
or you can just create a div then target it using querySelectors of javascript then use innerHTML.
I wrote some codes here for you. pls check the link:
https://jsfiddle.net/jLt5hjn8/

Related

Apple pencil click on button or anchor element not working on webapplication

We have a webapplication, which works fine when using the finger to touch for actions. We just got a apple pencil but that does not click the buttons or links, we can write using that in the textarea's, but any button click does not work. I tried to search for a probable solution, but could not figure our any directions. Any idea of what could be causing that will be very helpful.
One thing I was able to figure out, if I add the event onmousedown rather than onclick, all the events work, but I do not want to change the whole website code from onclick to onmousedown if there is another easier way of doing this. Thank you for any input !
I could not find a proper solution for this. But I have tried this and this seems like working find
$(window).bind('touchstart', function(e) {
e.target.click();
});

Hide and show menu after clicked on it

I have just started my study with css and html and I have first problem. I try to show my menu after clicked on it. When I clicked on it, menu item' s show up and immediately hide. How can I show it and hide after next click on my menu?
There is demo: jsfiddle.net/jekfej46/1/ Thanks a lot.
This is happening because :active is only a state. When you click an element, it changes the state to :active but only as you keep holding it. The best way to do it would be using jQuery to add a class to the menu when you click that button.
If you don't know how to use jQuery, there are lots of tutorials all over the internet that can easily guide you through. It's pretty easy once you get the principles.
Here's a working fiddle: http://jsfiddle.net/jekfej46/1/
In this case, JavaScript checks if the element already has the active class. If it does, the class is removed so the menu closes. But you can change that behaviour if you want.
You can't do the click event only with CSS. You need JavaScript here. Something like this will do this for you using jQuery.
$('#category').on('click', function(){
$('.dropdown-content').show();
});
Ohh, a lot guys. Now, I know that I also need js and jQ to improve my pages. Thanks.

How to create popup windows in html

I want to know how the pop up windows integrated into websites are built. I am trying to create one for my websites but i don't really know it is created whether they are plugins or not. Any help as to how to go about it.
Below is an example of what i want to do.
You can use hotjar.com to put a feedback box in your page, there is a lot of services that provides this feature, but hotjar gets the job done
Beginner! To make a pop-up like the one you provided, you would need to write backend code (Node.JS, PHP, Python, etc.). But for just a simple info pop-up with a button that activates the pop-up refer to this jsfiddle I created:
https://jsfiddle.net/d706dyg7/1/
$("#whateverid").click(function(){
//whatever code
});
That mean when that element is clicked blah happens.
Hope that helps,
Ben A.K.A BlackSky
P.S. If you want a solution in pure javascript and not jQuery just let me know and I will edit my fiddle!
I know I'm like .. 10 years late. But for anyone still wondering I thought I could be of some help!
If you want to do this using ONLY html and css (using a framework in visual studio like ASP.NET) for example.. here's what I did:
First, I made sure I had multiple "divs" in my code. For me specifically, I had two main ones. The first one whose id="main", and another whose id="popup" with the 'visible' property initially set to 'false' for the popup div.
Then, on whichever event you're looking for (button click for example) you'll simply set main.Visible = false and popup.Visible = true, then you could have more buttons in your popup (yes, no, cancel, confirm, etc.) which do the exact same thing, but in reverse!
The most important thing to make sure of is that you have the 'runat="server"' property in your divs so that you can access them in your CS code
Hope this was helpful! :)
Your looking for something called a modal. Depending how you wrote your HTML there are different ways of approaching this issue.
If your wrote your website in Plain HTML you can use the following tutorial to create one
www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/amp/
However if you wrote your website with a library such as Bootstrap they have built in pre made modules that you can attach to your cpde. These can Ben found in the library's documentation.

AngularJS Dynamically adding and removing HTML

Hi I'm trying to create a website where depending on what button is pressed, it will load HTML in a container corresponding to that button without having to reload the page. I was hoping someone could point me in the right direction to where I can learn how to do this. Thanks
This can be done easily with the Angular UI Router.
This page has a demo that (I think) does what you want:
https://ui-router.github.io/tutorial/ng1/helloworld
There may be some studying required to master this :)

Is there a way for a drop down list to open automatically using an anchor point?

In case it matters, I'm using WordPress as my website tool.
Basically this is what I have
<a name="title"></a>[expand title="title" trigclass=noarrow] Various text [/expand]
The anchor point is linked from a menu. Is there something I can add that when the anchor point is clicked, the drop down menu opens up? Either that, or is there another way for this to happen?
I'm very new to programming and I've tried looking on google but to no avail.
I'd appreciate any and all help!
Thanks!
yes there is .. you have to use jquery for that to happen...and instead of anchor ,, use a button with onclick EXPAND function..
Learn jquery thoroughly, it would be very helpful for further programming.