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="JavaS cript" type="text/JavaScript">
<!--
var mmWindow;
function windowOpener() {
if (!mmWindow || mmWindow.closed ){mmWindow=wind ow.open('where_ to_fi nd_us.htm','the window','width= 650,height=570, top=1 0,left=50, resizable,menub ar,statusbar,to olbar,scrollbar s');}
else{
mmWindow.close( );
mmWindow=window .open('where_to _find_us.htm',' thewi ndow','width=65 0,height=570,to p=10,left=50, resizable,menub ar,statusbar,to olbar, scrollbars');
}
}
function setDomain() {
var liBehindFirstDo t = document.domain .indexOf( "." ) + 1;
if (liBehindFirstD ot > 0) {
document.domain = document.domain .substr( liBehindFirstDo t );
}
}
setDomain();
function submitLogin(frm Login) {
// 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.g ases.boc.com/javalogin/javalogin.jsp?a lias=" + myLogin + "&password= " + myPassword + "&contact=B OC Customer Service&phone=0 800 111 333&logout_url= http://www.bocindustri al.co.uk";
//frmLogin.submit ();
}
}
function MM_preloadImage s() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; 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="javas cript:submitLog in(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>
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="JavaS cript" type="text/JavaScript">
<!--
var mmWindow;
function windowOpener() {
if (!mmWindow || mmWindow.closed ){mmWindow=wind ow.open('where_ to_fi nd_us.htm','the window','width= 650,height=570, top=1 0,left=50, resizable,menub ar,statusbar,to olbar,scrollbar s');}
else{
mmWindow.close( );
mmWindow=window .open('where_to _find_us.htm',' thewi ndow','width=65 0,height=570,to p=10,left=50, resizable,menub ar,statusbar,to olbar, scrollbars');
}
}
function setDomain() {
var liBehindFirstDo t = document.domain .indexOf( "." ) + 1;
if (liBehindFirstD ot > 0) {
document.domain = document.domain .substr( liBehindFirstDo t );
}
}
setDomain();
function submitLogin(frm Login) {
// 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.g ases.boc.com/javalogin/javalogin.jsp?a lias=" + myLogin + "&password= " + myPassword + "&contact=B OC Customer Service&phone=0 800 111 333&logout_url= http://www.bocindustri al.co.uk";
//frmLogin.submit ();
}
}
function MM_preloadImage s() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; 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="javas cript:submitLog in(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>
Comment