I have this button on my website which I am using to redirect to another page when clicked using the onclick function. The problem is, when it is clicked, it just shows the 404 page? Any ideas why this is happening?
<button class="btn btn-sm btn-badge" type="button" onclick="location.href = 'user_page.php&show=1?badge=Available';"><i class="fa fa-sort" style="color:#963"></i> Available </button>
It seems like you have your link incorrect - it should be ? first and then &.
Like this:
user_page.php?show=1&badge=Available
That should then solve your problem.
Try this :
onclick="javascript:location.href='user_page.php&show=1?badge=Available'"
Related
i've been editing a html website and want to add the a href tag to a button. Codewise everything seems well but the button doesn't do anything. Here the code:
a class="scroll btn btn-gradient btn-rounded btn-large" href="https://google.com" target="_blank">Visit google
Please help :(
Visit google
It looks like you forgot to close off the anchor tag.
I'm just a beginner and I'm trying to add a button with url to website.
It works in browser, but for some reason Dreamweaver keeps giving me error that special characters need to be escaped. Please help, what am I doing wrong?
Here's the button code I've written (of course button class has definition in style)
<button class="button button2", onclick="location.href=url.html">url_text</button>
Try this instead:
<button class="button button2" onclick="location.href='url.html'">url_text</button>
I am trying to web scrape with the following HTML by clicking on a button:
I have tried appIE.document.getElementById("btnAddFruit").click
<button type="button"
data-toggle="modal" data-target="#secondary-dialog"
id="btnAddFruit"
class="edt btn btn-red pull-right margin-left-10">
<span class="glyphicon glyphicon-plus-sign">
</span> Fruits</button>
The IE also does not show the pop up window.
Any help is much appreciated.
Edit: I made a typo on the ID and have corrected it
I am confused as the id shown is btnAddFruit
ie.document.querySelector("#btnAddFruit").click
Which is equivalent to
ie.document.getElementById("btnAddFruit").click
Otherwise, please detail what the error message is and on which line (show more of your code as well would help)
I am trying to make a lightbox appear when a button is pushed. Problem is, when the anchor is around the button (like in the code below), it automatically redirects to "mywebsite.com/myimage.jpg". However when the anchor is inside, only clicking the text will pop the lightbox. Here is the code:
<a href="myimage.jpg" rel="lightbox" title="Title!" style="color:white" class="lightbox">
<div>
<button class="btn btn-lg btn-block" style="background:red">Button Text!</button>
</div>
</a>
Anchors and buttons have two different intended purposes, though Bootstrap allows you to style either as a button. Pick one. Using both is just bad practice.
<a href="myimage.jpg" rel="lightbox" title="Title!"
class="lightbox btn btn-danger btn-lg btn-block my-button-class">Button Text!</a>
The .btn-danger variant gets you the white-on-red scheme you seem to be going for. See http://getbootstrap.com/css/#buttons-options.
If this doesn't solve your problem you'll need to be more clear about which lightbox plugin you're using and what properties it's looking for.
I am trying to make Disqus comment counter link in Bootstrap button, but everything I tried was unsuccessful.
The idea is that the whole button should be link.
When I am trying to do like this:
<a href="page.html#disqus_thread">
<button type="button" class="btn btn-default"></button>
</a>
the Disqus just overwriting everything about Bootstrap button CSS and just leave naked link like "1" (I left just number in disqus settings).
When I am trying this way:
<button type="button" class="btn btn-default">
</button>
the button appears, as well as comment counter link, but the button is not the link like if it was wrapped into <a> tag. So I need some help.
What you are trying is not valid HTML. Try something like this: