473,659 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirect to another page with button click

Decahedron
1 New Member
how do I get a button to open another page - I have this

<button type="button">B uggy Whipp Bio</button>

i need it to bring a user to buggy whipp bio.html

Any help would be appreciated
Nov 18 '08 #1
12 214774
acoder
16,027 Recognized Expert Moderator MVP
If you want to avoid JavaScript, then use a submit button and set the action to the page you want to redirect to:
Expand|Select|Wrap|Line Numbers
  1. <input type="submit" value="Redirect">
Of course, you shouldn't be submitting a form to redirect, so use JavaScript, or a link.
Nov 19 '08 #2
clain
79 New Member
Hey do this onclick="locati on.href='your_r edirectionpage. html'" enjoy
Dec 1 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Yes, that would be the JavaScript method of redirecting to another page.

You can also use the button tag as a submit button by specifying type="submit".
Dec 1 '08 #4
clain
79 New Member
yeah... but the submit buttom method wil have a posting and should have a form tag.. but this simple line of java script is worth while .. no extra fuss no posting.. jsut one click redirecting SIMPLE isn't it?
Dec 1 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
Yes, I agree and if this had been posted in the JavaScript forum, that's exactly what I would have suggested.

If you want to avoid JavaScript, or have users who may have JavaScript disabled, then you're left with the option of a link or a submit button.
Dec 1 '08 #6
clain
79 New Member
But Mr Decahedron is using <button> tag so the only option for redirection is onclick redirect... now he have to change the whole code to
<form action="somthin g.html" >
<input type="submit" >
</form>

??

its a lot more tag and you changed the whole <button> tage to 2 tages extra.. and a posting which would be a burden for the server...

i dont think that there would be people who disable javascript... in this web 2 world.. where everything work on javascript and Ajax...
Dec 1 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
@clain
That's not quite true. A lot of people for a number of reasons have JavaScript disabled or choose not to enable JavaScript, e.g. using the NoScript Firefox addon, or even do not support it. A web page should work without JavaScript and JavaScript should not be used for basic functionality on the page. JavaScript can be used to enhance the page for those who have enabled it. The exception is when you know your users, e.g. in an intranet or logged in staff in your company.
Dec 2 '08 #8
eWish
971 Recognized Expert Contributor
I am one who has the JavaScript disabled. It is interesting how many pages rely on it. Sometimes it is a hassle without it, but for the most part I like it better without JavaScript.

--Kevin
Dec 2 '08 #9
clain
79 New Member
I accept your point "accorder" ... for security reason we may disable it in a intranet of an organization.

if Mr Decahedron don't have any trouble in using JavaScript then,let he use it... rather that a lot more posting and a form..

and Kevin u missed a beautiful web world without JavaScript
Dec 4 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2372
by: amit.purohit | last post by:
hi, I have a very strange problem on my login Page. the Page was working fine a few days back, but now does not generate post back events for controls. this login page uses form based authentication. Whenever the button is clicked, no event is raised, infact it doesnt even go to the page_load as well. Events are registered and there is no problem with the code because the same code is working fine on Windows XP machine. The machine...
3
1830
by: Tom Nowak | last post by:
I have written a web app that includes a login page. When a user successfully logs in, they are taken to the main web app page. I have a button on this page that I want to use to redirect the user to another page, but i use a response.redirect statement behind the button, and when clicking this, I am taken back to the login page instead of the new page I want to goto. Help!
4
1660
by: COHENMARVIN | last post by:
I'm a asp programmer starting out with asp.net. I understand that an asp form can post to its own page and that this allows validation of form fields on the server. But suppose all the controls turn out to be valid, and now I want to move to a new page? My form declaration looks like this: <form METHOD="POST" ACTION="sites2.aspx" name="MyForm" runat="server"> This form declaration is on a page called sites1.aspx, but it doesn't post any...
8
1863
by: Kees de Winter | last post by:
Hi, On a form I have several submit-buttons, each of which should post its own set of variables (e.g. price and name of a product) to another page, e.g. an orderpage. There can only be one form, so what can I do now? I know I can do it using a Javascript function that sets the variables in the form, but isn't there any way without Javascript? Or can one rely on the user having Javascript. Using asp.net 2.0 VB.Net.
2
1826
by: hellboss | last post by:
HI ! I am workin wit asp.net vs 05 , I have some document file in my local directory and its corresponding path and its file name is strored in a the database table. In the Page 1, i have listed out all the Current doc which are present in my directory and, What i need is to delete a particular Doc file which is been selected, I use the Query string to send the file path and the file name to a procedure when its been clicked, ex:...
2
2294
by: namrataa | last post by:
Hi, I am working on mediaplayer using mediaelement in WPF usin VS2008 using C#. In my mediaplayer I have two tabs one is "Now Playing" and another is "guide". The "guide" tab is focused.The "guide" tab has some pages which allows user to select videos. When the user selects the video I want the "now playing " tab to be focused. So please help me to change the tab.
1
5909
by: zizi2 | last post by:
I have a form that I want to redirect to another page after clicking the submit button. It works well (please see the code below) except that it cancells my pop-up message, it goes the redirected page without showing the popup. Please help: private void Submit_Click(object sender, System.EventArgs e) { if( filMyFile.PostedFile.ContentLength != 0 ) { string strFilename; strFilename =...
1
3516
by: digituf | last post by:
can someone help me by telling me why is that whenever i click the javascript calendar, it redirect me to another page eventhough i still do not finish fill the form? here is the code: <?php session_start(); $_SESSION=$checkin;
0
2443
by: Anupam Jana | last post by:
Hello All, I want to redirect to some other directory page after displaying JavaScript alert message in ASP.net in a page. For that I tried bellow code in our application ~/Profile/MyProfile.aspx.cs file string redirectTo = "~/Logins/Login.aspx"; //The page I wish to redirect to. string script = "<script>"; //Begin Script tag script += "alert('" + ui_lblError.Text + "');"; //Javascript Alert...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.