Moby_Dim

msg:3285310 | 7:34 am on Mar 18, 2007 (gmt 0) |
Try to play with setting form action value to desired url instead of location may be.
|
penders

msg:3285535 | 4:16 pm on Mar 18, 2007 (gmt 0) |
| document.location.href=(Page + ".htm"); |
| You need to use window.location.href or simply, location.href to change the page in the window, not document.location. document.location (now deprecated in favour of document.url) is not the same as window.location. document.location is supposed to be read only. However, Netscape (and it appears FF) allow this property value to be changed.
|
Quang

msg:3288006 | 4:08 am on Mar 21, 2007 (gmt 0) |
Sorry I haven't been able to check back earlier. I've tried using both the window.location.href and the plain location.href, but neither will work. Any other suggestions? P.S. You can cut and paste the above code and use it to create an HTML page and test it out. All you need is another HTML page name "new_page.htm" to see if it works.
|
vincevincevince

msg:3288010 | 4:17 am on Mar 21, 2007 (gmt 0) |
First - are you running it from a local file? If so then the script may be blocked for security reasons. Upload it and test it. Second - try using top.location='' etc..
|
Quang

msg:3288013 | 4:32 am on Mar 21, 2007 (gmt 0) |
I am testing on a local file, but the scripts are not being blocked (the alert will show up in IE, but the page redirection will not). Also, I do have a page running on a web server, and I still have the same issue. The top.location.href still does not solve the issue. Any other suggestions?
|
daveVk

msg:3288020 | 4:45 am on Mar 21, 2007 (gmt 0) |
Try changing <input TYPE='submit' VALUE='Login' ONCLICK='check()'> TO <input TYPE='button' VALUE='Login' ONCLICK='check()'> No actual submit seems to be required and side effects may be an issue.
|
Quang

msg:3288039 | 5:15 am on Mar 21, 2007 (gmt 0) |
Thanks, that solved it. I changed the <input TYPE='submit' VALUE='Login' ONCLICK='check()'>
TO <input TYPE='button' VALUE='Login' ONCLICK='check()'>
Now, everything works - I can even have the alert prior to the page redirect, instead of after (which I couldn't before without an error). Thanks for your help.
|
penders

msg:3292013 | 7:15 pm on Mar 24, 2007 (gmt 0) |
Just a thought... an alternative would be to be to keep your button as a 'submit' button and use the onsubmit event of the form element instead, but always return false (preventing the form from actually being submitted): <form name="login" onsubmit="check(); return false;"> : <input type="submit" value="Login"> Either way, preventing the form from submitting seems to be the key (as daveVk suggested) in getting it to work in IE.
|
Quang

msg:3295466 | 3:18 pm on Mar 28, 2007 (gmt 0) |
Penders, Thanks for for the suggestion, it works great. I like the fact that I can still keep the type='submit', since the form now lets users press the 'enter' button to login (instead of clearing out the password when using the type='button')
|
cmarshall

msg:3295622 | 6:29 pm on Mar 28, 2007 (gmt 0) |
Just FYI. I have used the window.location.href=[i]URI[/i] before, but I believe the proper way to do it is to use the accessor [w3schools.com]. To wit: window.location.href.[red][b]assign([/b][/red][i]URI[/i][red][b])[/b][/red]
|
|