input button to load new page

M

Moist

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
 
I

Ivo

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?

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
 
L

Lasse Reichstein Nielsen

Ivo said:
<input type="button" onclick="location.href='/some/page.htm';">

Or, without Javascript:

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

/L
 
M

Moist

Lasse Reichstein Nielsen said:
Or, without Javascript:

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

/L
'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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top