473,405 Members | 2,415 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,405 software developers and data experts.

Form - click button to new page

4
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 when pressed sends 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 –


See code below

Grateful if anyone can offer any help
Thanks Hemong

Code: ( html4strict )

<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: contact department - Displayed if login fails
// phone: 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>
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=" > " />
8. </label>
9. <label></label>
10. <input type="submit" name="Submit" value="Register" /></a>
11. </form>
May 30 '07 #1
2 2865
If you don't want any data from the current page passed to the script would a simple link suffice and perhaps CSS it? If you really want a button and CSS'ing isn't sufficient, have you tried an input type of button with an onclick event?

Briefly...
Expand|Select|Wrap|Line Numbers
  1. function gotoRegister()
  2. {
  3.    document.location.href = "register.asp";
  4. }
  5.  
  6. <input type="button" name="regbtn" value="&gt;" onclick="gotoRegister()" />
  7.  
May 31 '07 #2
In input type specify the src attribute to your image for next and onclick call gotoRegister function.....

<input type="image" name="" src="/next.gif" onclick="return gotoRegister()">

If you don't want any data from the current page passed to the script would a simple link suffice and perhaps CSS it? If you really want a button and CSS'ing isn't sufficient, have you tried an input type of button with an onclick event?

Briefly...
Expand|Select|Wrap|Line Numbers
  1. function gotoRegister()
  2. {
  3.    document.location.href = "register.asp";
  4. }
  5.  
  6. <input type="button" name="regbtn" value="&gt;" onclick="gotoRegister()" />
  7.  
May 31 '07 #3

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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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...
0
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...

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.