Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Carrying values from a form to a pop up box with Javascript

Posted on 2002-03-26
9
Medium Priority
?
226 Views
Last Modified: 2013-11-28
I want to have a login area on the homepage and once users fill in their username and password I want to use a pop up box on the screen to tell them the results.  

The problem: I can't get seem to carry the values from the 2 fields, useranme & password, from the homepage to the pop up box using Javascipt.

I can use Javacript to launch the pop up window but not carry the values across.

Any ideas?

One thing I don't want to do is use a querystring or something that exposes values because I don't want to show passwords.

Derek.

0
Comment
Question by:dgwest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 2

Expert Comment

by:DanielBlais
ID: 6896819
You may call another page.  If the login and password are correct, store them in a session variables.  And them open the pop-up in javascript.  In the pop-up, verify the session variables are ok and display the data.
0
 
LVL 3

Accepted Solution

by:
barryfandango earned 200 total points
ID: 6896844
dgwest,

Please elaboriate on what you mean by "the results."  What is it you wish to display in this popup window?

I'm assuming your problem is that you want to pop up an ASP page that will verify the user's login and password.  How about this:

1. user inputs login/pw on main ASP page, hits Submit
2. main page reloads, passing itself the login/pw in the form of Form Data.
3. an ASP script at the top of the main page checks for form data, validates the login/password, and generates a javascript routine to pop up the results.

i.e.

<%
'check to see if form was submitted
if len(request.form("login"))>0 then
  ...(script to check l/p)...
  if validated = true then
    message = "You have been successfully logged in."
  else
    message = "Login or Password incorrect."
  end if
  response.write("<script language=""javascript"">")
  ...(etc. - generate a script to pop up a window displaying the "message" variable.)...
end if
%>

Hope this helps.
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6896848
dqwest,

Javascript popup a xx.asp

in the xx.asp validation the password, and response.redirect goto other page --> Password Correct/Password Error

In this case, when in the last page, use canot see the querystring. and you can pop up a page to disable the header for the browser, more safe.

Best Regards,
Wee Siong
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dgwest
ID: 6896941
barryfandango,

I like what you've proposed.  Let me try it.  I don't know how to fire the javascript popup window though.  
0
 

Expert Comment

by:taftman
ID: 6896996
javascript popup window:

function openWin(){
window.open("yourPage.html","NameOfPage","width=550,height=550,screenX=300,screenY=90")
}
0
 

Expert Comment

by:taftman
ID: 6896999
or do you mean an "alert box"?

alert("stuff in here");

or displaying variables:

alert(foo);
0
 
LVL 3

Expert Comment

by:barryfandango
ID: 6897008
dgwest,

you could create two HTML files, one with the confirmation message and one with the denial message.

modify the above script to read like:

if validated = true then
   message = "yes.html"
else
   message = "no.html"
end if

Then create your new window:

response.write("<script language=""javascript"">")
response.write("window.open(" & message & ",""theWindow"",""height=200,width=200,menubar=no,directories=no,scrollbars=no,toolbar=no, resizable=no"")")
response.write("</script>")

Within yes.html and no.html, you might want to include a button that fires "window.close()".
0
 

Author Comment

by:dgwest
ID: 6897013
barryfandango,

I like what you've proposed.  Let me try it.  I don't know how to fire the javascript popup window though.  
0
 
LVL 2

Expert Comment

by:manihopever
ID: 6898915
Dear dqwest,

i have just coded a sample, make few changes and flexible things to work.

login.asp
----------
<script language=javascript>
  function showPopup(){
    pop= window.open("validate.asp","validate","width=100, height=200")
    document.frm.target = "pop"
    document.frm.submit()        
  }
</script>
<form name=frm onsubmit="">
<input type=text name=login>
<input type=password name=password>
<a href="javascript:void showPopup()">login</a>
</form>

validate.asp
------------
<%
strlogin = Request.Form("login")
strPwd   = Request.Form("password")
if strlogin="dqwest" and strpwd="pass" then
  response.write "welcome dqwest"
else
  response.write "illegal entry, please try again."  
end if  
%>
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Choosing a core focus or particular set of features and options can be tough. To help out, we’re going to highlight a handful of things your business needs on one of your social media pages. In other words, if one of these is missing, you should imp…
Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
An overview of how to create reports in Adobe Analytics (formerly Omniture Site Catalyst) using pageNames, events, eVars and props. This video will show you how to install the Omniture Debugger tool so can see (and test) what is being passed int…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question