this is our code; we tried to link a page with a button, but the page is not opening,instead after clicking the button it redirects to the same page as the button.
The code for the button is:
<a href="search.html"><div class="form-group">
<button name="signup" class="btn btn-lg btn-primary btn-block" type="submit">Send Query</button></div></a>
Please help us debug this.
I think you should add your css classes on the link so it looks like a button Send Query
Your question is not clear at all, try this code,
Send Query
Make sure that you have placed the files in same directory?
And then Try this code :
<div class="form-group">
Signup
</div>
Then you may give your anchor tag look and feel same like button.
Related
I made an HTML-button, in the code shown below:
<div style="" class="button-box" >
<button>Useradministration</button>
</div>
When I click on it, I want it to redirect the user to the /admin-url.
How should I do this? How do I make Django "know" that the button has been clicked?
Thank you so much for your time!
you can use like this:
<a class="btn btn-primary" href="/admin-url">Useradministration</a>
For button Click Navigation to another URL in Django
<button onclick="location.href = '/pageurl'">Click</button>
For a button-click redirect to another URL in Django :
<button>Click</button>
Another way :
<button onclick="window.location='projects';">Projects</button>
<a href="./your-url">
<button>button text</button>
</a>
I wanna switch this code:
Inapoi
With a button. I want a button who redirect to ”selectare_gen.php”
I tried:
<button onclick="location.href='selectare_gen.php'">Inapoi</button>
But all it does is refreshing the current page..
It should be
<button type="reset" onclick="location.href='selectare_gen.php'">
Inapoi
</button>
The type="reset" is a workaround to prevent the browser from interpreting the button as a form element which causes the reload.
Check this link over here. It should answer your question.
How to create an HTML button that acts like a link?
Many browsers think that the <button> tag will cause a submit that's why it's appearing to just refresh the page. If you use an input type="button" it wouldn't have this effect:
<input type="button" onclick="window.location='selectare_gen.php';" value="Inapoi" />
I am working on a project, in which needs generation of bill. what is the code for which if we click a button then it will print a hard-copy for the user
try this:
<button onclick="window.print()">Print</button>
you can obviously use <a> or <input> and put onclick="window.print()" in there
You can do it using javascript...Try like this
<input type="button" value="Print This Page" onClick="window.print()" />
I click edit page on my google site and then add html box where i add this code
<button type="button" onclick="window.open('http://www.google.com','_blank','resizable=yes')" >Click to open Google</button>
But for some reason it doesn't work, although i tested it on some html editors and it worked.
Any ideas?
you can also try this
<input type="button" value="Click to open Google" />
It may be some kind of security feature, the code is correct, you can see it Here. But Here it doesn't work too.
You can try to use a link:
Click to open Google
Ps.: It's good to close all tags (</button> after button's text):
<button type="button" onclick="window.open('http://www.google.com','_blank','resizable=yes')" >Click to open Google</button>
hello all a quick question..
i am building a static html page, and would like to like one page to another using a button, now using a link is the easier option but i would like the effect of a button without any javascript going off..
so i would like to use a input button but it to link to a html page like an tag can href.
i was thinking along the lines of this example but without the js..
<form>
<input type="button" value="Read more" class="button" onclick="window.location.href='testimonials.html'">
</form>
this doesnt work but i am looking for this functionality?? is it possible?
Just submit the form to the URL.
<form action="testimonials.html">
<input type="submit" value="Read more">
</form>
… but buttons are supposed to do stuff. Links go places. Don't send people mixed messages, use a link.
you've misspelled "onclick" :)
EDIT: if you want to avoid javascript, you can create a button-like link with CSS:
Read More
Try this code:
<form>
<input type="button" value="Read more" class="button" onlick="window.location='testimonials.html'">
</form>