473,796 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

input button to load new page

Hi,

I know this may be a trivial question but I wonder if it is possible to load
a new HTML page (without opening a new window) by just clicking an input
button.

Is there a way to do this right inside the "input" tag or I must call a
JavaScript function? If this is the later case, how can I do this within
that function?

Thanks!
Moist
Jul 23 '05 #1
3 26814
Ivo
"Moist" wrote
I know this may be a trivial question but I wonder if it is possible to load a new HTML page (without opening a new window) by just clicking an input
button.
<input type="button" onclick="locati on.href='/some/page.htm';">
Is there a way to do this right inside the "input" tag or I must call a
JavaScript function? If this is the later case, how can I do this within
that function?


Both is possible. There may be a few advantages in creating a function if
the url of the new page is in a variable or something.
The question is whether your users will understand what is going on, as
input buttons do not usually load new pages.
--Iv
Jul 23 '05 #2
"Ivo" <no@thank.you > writes:

<input type="button" onclick="locati on.href='/some/page.htm';">


Or, without javascript:

<form action="/some/page.html"><inp ut type="submit" value="Go!"></form>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #3

"Lasse Reichstein Nielsen" <lr*@hotpop.com > a écrit dans le message de
news:u0******** **@hotpop.com.. .
"Ivo" <no@thank.you > writes:

<input type="button" onclick="locati on.href='/some/page.htm';">
Or, without javascript:

<form action="/some/page.html"><inp ut type="submit" value="Go!"></form>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors:

<URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html> 'Faith without judgement merely degrades the spirit divine.'


Bingo! This is what I was looking for. To answer the other reply from Ivo,
my users will navigate through pages using buttons, this is to simulate an
application. They won't use the usual navigation stuff.

Thanks!
Jul 23 '05 #4

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

Similar topics

4
1789
by: Symphony | last post by:
Hi, All: I am using vb.net developing web application. I am new in web application. My issue is: I have a button "btnCalculateTotal" on a web page (form), click this button, the "btnCalculateTotal_Click" event will calculate the total and beside the button there is text field will show the result. but each time when I click the button, the page will be reload and goes to the top of the page. How should I just click the button, do not...
2
1255
by: Stephen Noronha | last post by:
Hi all, I have an input button <input type="button" id="Button2" name="Button2" value="More" onclick="openPage()"> this input button onclick opens another page. this "More" button is for additional information only (say I have extra notes), and if there is none available then it should not appear.
2
1071
by: Stephen Noronha | last post by:
Hi all, I have an input button <input type="button" id="Button2" name="Button2" value="More" onclick="openPage()"> this input button onclick opens another page. this "More" button is for additional information only (say I have extra notes), and if there is none available then it should not appear.
1
3130
by: sonicsoul | last post by:
Hi, i wanted to define default global styles that would be used by 90% of controls. I would like to differentiate input text controls from input button controls. is there a way to specify this in this sort of way: input text { font-family: verdana; } input button { font-family: arial; } also, if i do this, and than override specific controls with custom styles, would it be recommended practice?
3
2763
by: vishnu | last post by:
Hi, I am using HTML input file button to browse the file and just am updating the file name in sql server table.But now i want to browse the file from the remote file share path ..How can i specify this path in HTML input button.Is there anyway to open the file from the specified path instead of opening local directory? Thanks,
4
13308
by: Chris | last post by:
Hi, i 'm experimenting with postback and i tried that with a button server control and an Html input button but with runat="server". The button server control causes a postback, but not the Html input button with runat="server". Can someone explain me why (because it's running on the server)? Thanks
18
2628
by: bning | last post by:
Hmm this forum really doesn't give you long enough to type in your question before logging you out.. well here goes my second attempt: I'm trying to teach myself javascript with dom scripting and am attempting to write an application as I learn. It's been going fine but I've ran into a problem which is driving me crazy. I'll start off by explaining what I'm trying to achieve... I'm simply trying to insert an input button into a table at a...
1
1305
by: shapper | last post by:
Hello, I have an image button on my web site. When clicked I want to redirect the user to a new page. Not a PostBack. How can I do this? Thanks,
10
40643
by: bgold12 | last post by:
Hey, I know of two ways to place a link on an HTML page; (1) use the anchor element, and (2) use javascript to respond to an event (such as onclick) and set the location. I recently started using anchors more, and I eventually happened to try to put an anchor link around an input button, as you can see: <a href="example.com"><input type="button" value="Example" /></a> This worked fine in Firefox and Chrome, but it doesn't have any...
0
9673
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
9525
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
10452
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
10221
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
7546
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
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.