473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 26795
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="location.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="location.href='/some/page.htm';">


Or, without javascript:

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

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.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="location.href='/some/page.htm';">
Or, without javascript:

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

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

<URL:http://www.infimum.dk/HTML/rasterTriangleDOM.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
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...
2
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...
2
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...
1
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...
3
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...
4
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...
18
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...
1
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.