473,386 Members | 1,752 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,386 software developers and data experts.

showModelessDialog problem

Just discovered the showModelessDialog feature.

Here is my problem.

I Created a link on page 1 that opens modeless popup password window.


[HTML]<A onClick="window.showModelessDialog('smPassword.asp ','ScrollData','status:false;dialogWidth:400px;dia logHeight:200px')">
<U>My Password</U>
</a>
[/HTML]
Works Great !

From that Password page ('smPassword.asp'), I enter the password, verify it is valid and then open another page for data entry.

Expand|Select|Wrap|Line Numbers
  1.  <Div align="center">
  2.  
  3.      <h3>Enter Password</h3>
  4.           <form method="Post" ACTION="">
  5.                <input type="password" name="pwd" value=""><br><br>
  6.                <input type="submit" value="Enter Password" onClick="checkpwd(this.form)">
  7.           </form>
  8. </Div>
Expand|Select|Wrap|Line Numbers
  1. function checkpwd(form)
  2.  
  3. {
  4.   var pwd;
  5.       pwd=form.pwd.value;
  6.  
  7. if (pwd == "Password")
  8.    {
  9.       window.open("<%=strServerName%>/Path1/Path2/BlahBlahBlah.asp", "windowname", "height=500, width=1015, left=1, top =1, resizable=yes, dependent=yes, scrollbars=yes");
  10.    window.close(); 'This closes the dialog window confirmed it works correctly
  11.    <%
  12.    Session("loginokay") = True
  13.    %>
  14.    } 
  15.  
  16.  else
  17.    {
  18.        alert("Incorrect Password - Please Try Again !");
  19.    }
  20. }
  21.  
Works GREAT except.....

the BlahBlahBlah.asp window opens and then....

the 'smPassword.asp' window re-opens (remember we closed it and verified it in the code), on top of BlahBlahBlah.asp and NOT in the modeless view.

I have to close it and the BlahBlahBlah.asp page is there good to go.

One last thing, If I call a Non Existant window in the window.open(<%strServerName%> code the Page Cannot Be Found window opens AND so does the smPassword window in NON dialog mode. I have checked code in all affected pages and there is absolutley no other reference to smPassword.asp.

Very Weird.


Question: What is causing the 'smPassword.asp' window to open again.

--------------------------------------------------------------------------------
frozedog
Dec 20 '07 #1
3 1751
acoder
16,027 Expert Mod 8TB
You're pressing the submit button and not preventing the submit. It submits to itself. In checkpwd, return false at the end to prevent the submit.

PS. you should never check passwords using client-side code.
Dec 22 '07 #2
Thanks for your response. Of course you were correct. I am very new at JavaScript and would like to pick your brain as to how you suggest to verify passwords.

Thanks again for your help
Dec 27 '07 #3
acoder
16,027 Expert Mod 8TB
Check on the server-side so that the user can't view the source and see the password in all its glory.
Dec 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: datactrl | last post by:
Hi, all When I use window.showModelessDialog() to open a window. And then on the opened window to open an another window with the same function, window.showModelessDialog(). The last opened one...
12
by: oeyvind toft | last post by:
I`m dynamicly creating a doc for a modeless window in IE 6.. win= showModelessDialog(oArgs, window, sFeatures); win.document.title = 'some title'; doesnt work. Any ideas ? oeyvind
1
by: Alex | last post by:
Sorry for the basic questions; just starting with ASP.NET I am using an HTML button to open another modeless dialog window: <INPUT style="FONT-WEIGHT: bold; Z-INDEX: 119; LEFT: 48px; WIDTH:...
0
by: Alex | last post by:
I am using an HTML button to open another modeless dialog window: <INPUT style="FONT-WEIGHT: bold; Z-INDEX: 119; LEFT: 48px; WIDTH: 103px; COLOR: navy; FONT-STYLE: italic; FONT- FAMILY: arial;...
0
by: Fuv | last post by:
My problem is about web applications (ASP .net) developped in C# that are used with an IIS Server (v. 5.1 and 6.0 tested) . I'm using a web application that opens other web applications with a...
5
by: anand basha | last post by:
what is the replacement for window.navigate in mozilla & i was used window.showmodelessdialog in IE5 - in mozilla it is not working *** Sent via Developersdex http://www.developersdex.com...
8
by: comando | last post by:
Hi I built an application that open a modelessDialog my question is can i replace the modelessDialog content on a click in the parent window i need this in order to prevent multiple...
1
by: sathyanrockie | last post by:
Plase tell me what is the difference between window.open and window.showmodelessdialog. Can we use window.showmodelessdialog in place of window.open?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.