BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 01:44 pm
Great, sounds good to me.

I wasn't sure if I could do this or not, I am suprised that I dont have to use a form handler like a cgi script to do it.

Any particular reason why I dont need to send the information to a specific handler?
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 9 Sep, 2003 01:51 pm
Hmm, I need to lookup some javascript references. I have some work to do and since they pay me I gotta give that priority.

I'll look at this later.
0 Replies
 
BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 02:02 pm
Ok.. I'll be on the look out for some code to submit a form using an image.

Thanks for the help.
0 Replies
 
BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 02:38 pm
Btw, is there a way to make the script display a message before they log in if the information is incorrrect.

So if they enter a bad username/password, something would come up saying there is an error?
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 9 Sep, 2003 02:42 pm
First of all here is the script enabled for an image button. It was driving me nuts but then I figured out that the onclick works differently if you use an image instead of a button. I had to add a return false.

Here is the functional code, I have the username boby and password bobby hardcoded in because I was testing but you can fix it up and it should work:

Code:<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server + username + "/";
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</script>
</head>
<body>
<form name=login>
<input type="hidden" name="server" value="www.mrbobdouglas.com/">
Username:
<input type=text name=username size=20 value="bobby">
<br><br>
Password:
<input type=password name=password size=20 value="bobby">
<input type=image src="submitimage.gif" onClick="Login(this.form); return false;">
</form>
</body>
</html>


Now as to your lastest question I do not think it is possible to do with javascript.
0 Replies
 
BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 06:12 pm
Hmmmmm.... Something is wrong. It is still taking me to the same weird URL. You can try the login.php page again to see it.

Code:<tr>
<form name=login>
<td colspan="2" width="235" height="79" background="images/login_bg.jpg" valign="top">
<div style="padding-top:15px;padding-left:35px;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px;">Username</td>
<td style="padding-left:12px;">
<input type="hidden" name="server" value="www.mrbobdouglas.com/">
<input type="text" name="username" style="width:80;height:20" size="20"></td>
</tr>
<tr><td height="3"></td></tr>
<tr>
<td style="font-size:10px;">Password</td>
<td style="padding-left:12px;">
<input type="password" style="width:80;height:20" size="20">
</td>
</tr>
</table>
</div>
</td>
<tr>
<td colspan="2">
<input type=image src="images/login_enter.jpg" onClick="Login(this.form); return false;">
</tr>
</form>
</tr>


Im wondering if the fact the
Code:<input type=image src="images/login_enter.jpg" onClick="Login(this.form); return false;">

is not inside the same cell that it makes a difference? Any ideas, eh.
0 Replies
 
BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 06:13 pm
It works fine on my test1.html page....
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 9 Sep, 2003 07:45 pm
It was a major pain to find what you did wrong. It was a simple one but I checked all your scripts etc etc but it's just that you didn't name the password field.

Do not leave this out: name=password
0 Replies
 
BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 07:46 pm
Haha im a dumbass, I just reviewed my code and found no name="password" LOL


Anyways, I still cant get the script to use an image map....
0 Replies
 
BobbyDouglas
 
  1  
Reply Tue 9 Sep, 2003 11:26 pm
Ok, screw the image map.

Craven, take a look now at the other pages on my site. Just updated it with sliced images. Smile

Ty very much! How old are you btw?
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 10 Sep, 2003 08:52 am
Yeah, definitely screw the image map. You can acheive the same results with a image submit button.

I'm 23.
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Member Login
  3. » Page 2
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/16/2024 at 02:22:10