Take the 2-minute tour ×

this question might seem stupid, but here's the situation: I'm trying to create an auto login page for my mail using jquery's post request, but it's not working, it works with all other pages except with webmail. So, trying to figure out what was wrong, I recreated the login form, here's the code:

<form id="form1" name="form1" method="post" action="https://login.hostmonster.com/">
<input type="text" name="login" id="user" />
<input name="password" type="password" id="pass" />
<input name="doLogin" type="submit" id="doLogin" value="Login">

The strange thing is when you change the input type of pass to text, the form doesn't work! I can't figure out why. Anyway, if you can tell me what's the real difference between the input type text and password (and not what it says everywhere on the net that the only difference is that when you type stars appear instead of characters) I would appreciate it. Also, do you think this is affecting my jquery's post? Here's the code for it:

$j.post('https://login.hostmonster.com/', { login: 'xxx@example.com', password: 'xxx' }, function(data, text){
 if (text=='success')
  alert('Success '+data);
  } });

Thanks a lot! Regards,


share|improve this question
is that your actual jQuery code? If you're using hard coded values for the login and password, your form shouldn't matter at all... –  gapple May 17 '10 at 23:13
I think we need a little more code. –  BradBrening May 17 '10 at 23:18
I'm sorry, I didn't express myself good... The jQuery is my code, the form is just what I did to find what was wrong with my jQuery... The form has nothing to do with the jQuery –  Domingo May 17 '10 at 23:21
Are you sure this is not a typo? Your password field has the "type" and "name" parameters switched in relation to your "login" field. Maybe you where changing its name instead of its type. –  kikito May 17 '10 at 23:40
BTW the jQuery code doesn't display neither the success message nor the failed message. –  Domingo May 17 '10 at 23:41
show 1 more comment

2 Answers

up vote 0 down vote accepted

One big problem that I see here is that the response will be stored in the variable data and not test. test is loaded with textStatus which, if I am not mistaken, only tells you whether your request went through. In other words, your script should be validating even with a bad password.

Here are some things to ask yourself, and perhaps let us know. First, is that the only thing that you changed? Does your form work without JavaScript? How does your script set and load the values entered? When you say that "it's not working", what is it not doing? Using a packet sniffer will help you see exactly what is getting sent as well as what is coming back.

Your browser should be interpreting "text" and "password" pretty much the same when it comes to data sent. However, some browsers don't follow the standards. Also, jQuery could be doing something different, but I've never heard of it before.

share|improve this answer
add comment

Another difference aside form the stars is you can't copy (Ctrl+C) the data in a password field.

share|improve this answer
add comment

Your Answer


