473,473 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form - click button to new page

4 New Member
Hi, wondering if anyone can help me
I have created a form and user id, password that allows the user to submit and all this works fine however I want to create another button next to the ' > ' submit button within the form that customers can press that will direct them to a page called '/register.asp' button name 'Register' - however when I create this button it 'submits' the data

See code below

Grateful if anyone can offer any help
Its a ork project that I have to finish asap
Thanks Hemong
Expand|Select|Wrap|Line Numbers
  1. <form name="formLogin" method="post" onSubmit="javascript:submitLogin(formLogin);" target="_blank">
  2. User name
  3.  <input type="text" name="username" class="input" size="20" />
  4. Password
  5.  <input type="password" name="password" class="input" size="15" />
  6. <label>
  7. <input type="submit" name="submit" value=" &gt; " />
  8. </label>
  9. <label></label>
  10. <input type="submit" name="Submit" value="Register" /></a>
  11. </form>
May 25 '07 #1
4 1527
jhardman
3,406 Recognized Expert Specialist
Hi, wondering if anyone can help me
I have created a form and user id, password that allows the user to submit and all this works fine however I want to create another button next to the ' > ' submit button within the form that customers can press that will direct them to a page called '/register.asp' button name 'Register' - however when I create this button it 'submits' the data
It certainly looks like you are trying to submit the data. Would you like it to do something else? Instead of type="submit" try type="button" then you will have to give it onClick code
Expand|Select|Wrap|Line Numbers
  1. onClick="window.location='register.asp'"
  2.  
Or do you want to submit the data but to a different page?

Jared
May 25 '07 #2
hemong
4 New Member
It certainly looks like you are trying to submit the data. Would you like it to do something else? Instead of type="submit" try type="button" then you will have to give it onClick code
Expand|Select|Wrap|Line Numbers
  1. onClick="window.location='register.asp'"
  2.  
Or do you want to submit the data but to a different page?

Jared
Hi Jared
Thanks for the reply - I actually maybe in the wrong forum - firstimer, not really sure about things yet.
I forgot to add the script before (see below)
I have created a form that asks you for an ID Name and password to allow you to continue. However I also wanted a button when pressed sent you to another page (register.asp) so that a customer could register there details if they wanted to view the site. Hope this makes sense. I just want a customer to able to press a button that sends them to another page -
Regards
Hemong

<script language="JavaScript" type="text/JavaScript">
<!--



var mmWindow;
function windowOpener() {
if (!mmWindow || mmWindow.closed){mmWindow=window.open('where_to_fi nd_us.htm','thewindow','width=650,height=570,top=1 0,left=50, resizable,menubar,statusbar,toolbar,scrollbars');}
else{
mmWindow.close();
mmWindow=window.open('where_to_find_us.htm','thewi ndow','width=650,height=570,top=10,left=50, resizable,menubar,statusbar,toolbar, scrollbars');
}
}

function setDomain() {
var liBehindFirstDot = document.domain.indexOf( "." ) + 1;
if (liBehindFirstDot > 0) {
document.domain = document.domain.substr( liBehindFirstDot );
}
}
setDomain();

function submitLogin(frmLogin) {

// Get username and password from user input

var myLogin = new String(frmLogin.elements["username"].value);
var myPassword = new String(frmLogin.elements["password"].value);

// Check that both username and password are entered

if (myLogin == "" || myPassword == "") {
alert("Please enter a username and password");
}
else {
// Login via javalogin

// alias: username
// password: password
// contact: BOC contact department - Displayed if login fails
// phone: BOC phone number - Displayed if login fails
// logout_url: Logout url

frmLogin.action = "https://pgw100.portal.gases.boc.com/javalogin/javalogin.jsp?alias=" + myLogin + "&password=" + myPassword + "&contact=BOC Customer Service&phone=0800 111 333&logout_url=http://www.bocindustrial.co.uk";
//frmLogin.submit();
}

}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
May 25 '07 #3
jhardman
3,406 Recognized Expert Specialist
Yeah, this is really more of an html question in my mind. Any input of type "submit" will submit the form. So I would definitely do this as I showed in my last post: use type="button" and then set an onClick attribute which sends you to the register page.

Is this working for you now?

Jared
May 28 '07 #4
hemong
4 New Member
Yeah, this is really more of an html question in my mind. Any input of type "submit" will submit the form. So I would definitely do this as I showed in my last post: use type="button" and then set an onClick attribute which sends you to the register page.

Is this working for you now?

Jared
Thanks I'll give it a try
May 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
1
by: Hugo Botha | last post by:
Hi, I have created 2 asp pages called testa.asp and testb.asp testa.asp has a link to go to next page testb.asp testb.asp has a form that ask you for a reference number and post it to the...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
4
by: John Fereira | last post by:
So, one of the limitations of multipart-form handling is that when an <input type="file" ..> tag is used it will bring up a window which allows a user to select a file for upload but won't allow...
7
by: | last post by:
I am having trouble figuring out to call a database INSERT procedure from a simple submit form. It appears I should use the onclick event to trigger the procedure called BUT when I do this I...
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
3
by: ApexData | last post by:
I'm starting a new project. A Personnel System. I have considered opening a single bound form to the main employee table. The user can scroll the records to any individual. I would like to have a...
4
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't...
1
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent...
0
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,...
0
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,...
0
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
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.