Remember Login using cookies and javascript

Hello all,
This is an urgent request. Pls reply asap.
I have two jsps one in English and other in french. I need to implement a functionality to remember the username in both these jsps. I have a function written in javascript to check if the "remember me" checkbox is enabled and then remember the user name. But it is not working as expected. It remembers in one jsp and if i go to french jsp all the info is lost.
Can you pls help me? Sample code would help.
I guess the cookie works only for the jsps under certain folder path say en/jsp/.. and fr/jsp/..

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Login Form</title>
</head>
<body>
<form name="login" method="post" action="Home.jsp">
Email : <input type="text" name="email" /><br />
Password : <input type="password" name="password"/><br />
<input type="checkbox" name="rememberChk" value="on" />Remember Me <br/>
<input type="hidden" name="remember" value="0"/>
<input type="button" value="Sumbit" onClick="submitForm()"/>
</form>
</body>
<script>
     <%
     String email="";
     String password="";
     Cookie cookies [] = request.getCookies ();//Get All Cookies from Client Device
     if (cookies != null){//Check cookies are available
          for (int i = 0; i < cookies.length; i++){
               if (cookies .getName().equals("password")){
                    password=cookies[i].getValue();//Password which is saved on cookie
                    break;
          for (int i = 0; i < cookies.length; i++){
               if (cookies [i].getName().equals ("email")){
                    email=cookies[i].getValue();//Email which is saved on cookie
                    break;
     }%>
     function submitForm()//Submit function with checkbox determined value
          if(document.login.rememberChk.checked)
               document.login.remember.value = 1;
          else
               document.login.remember.value = 0;
          document.login.submit();
     document.login.email.value="<%=email%>";
     document.login.password.value="<%=password%>";
</script>
</html>
login.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Home Page</title>
</head>
<body>
<a href="logout.jsp">Logout</a><br />
<%
     String email;
     String password;
     String remember;
     email = request.getParameter("email".toString());
     password = request.getParameter("password".toString());
     remember = request.getParameter("remember");
      *if Remember Checkbox is Checked
      *then Save Email and passwod into Cookie
      *and Add Cookies into response/Client Device
     if(remember.equals("1")){
          Cookie pass = new Cookie("password",password);
          Cookie emailAdd = new Cookie("email",email);
          //Setting maximum Expiry Date Of Cookies
          pass.setMaxAge(365);
          emailAdd.setMaxAge(365);
          //Make Persistent Cookie onto Client Device
          response.addCookie(pass);
          response.addCookie(emailAdd);
%>
<h4>Welcome - <%=email%> </h4>
Your password is : <%=password%> <br />
</body>
</html>
Home.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<html>
<%
Cookie cookies [] = request.getCookies ();//Get All Cookies from Client Device
if (cookies != null){//Check cookies are available
     for (int i = 0; i < cookies.length; i++){
          if (cookies .getName().equals("password")){
               Cookie cookie = cookies[i];
               cookie.setMaxAge(0);
               response.addCookie(cookie);
               break;
     for (int i = 0; i < cookies.length; i++){
          if (cookies [i].getName().equals ("email")){
               Cookie cookie = cookies[i];
               cookie.setMaxAge(0);
               response.addCookie(cookie);
               break;
response.sendRedirect("login.jsp");
%>
</html>
logout.jsp

Similar Messages

  • Using cookies and JavaScript to create a page to page timer.

    I have long wanted to be able to measure the time it takes to get from one page to another.  While reading in my JavaScript reference the other day, I came across cookies.  I've long known about cookies but have never used them.  The thing that looked attractive was that you can access cookies from both JavaScript and CF.
    So I put together the procedures to store the "start time" (startTimeP8D) for the transition and activated it on the onUnload event of a 1stpage.  After a few rewrites I got it working.   Here is the JavaScript to do that: it consists of two functions: doTimer which is the input section and setCookie, which writes to the cookie.  Not the two numbered alert statements.
    doTimer - results for "start" from the doTimer function called from page 1 when it unloads. (See doTimer below)
         Please note that the two startTime8D values are the same immediately after they are stored.
    On the 2nd page in the sequence, I run the corresponding code to determine the "end time", compute the delta and write it out to the page.  It didn't all run on the first try, but it now seems to be running without a crash, which can be misleading.
          second set of outputs from page 2:    
         Please not that while the endTimeP8D match, the startTimeP8D value no longer matches the previously stored value. 
    There is one major hitch in the get along which has me stymied:  As you can see, when you compare the startTimeP8 in the setCookie – results above and the "startTimeP8" in the doTimer results below the startTimeP8 is not the value that I wrote to the cookie @ unload of page 1.  I have checked and checked and do now see anywhere that the startTimeP8D value is being overwritten.  Based upon my limited experience with JavaScript cookies, it seems to me that you get an entry for each time you set the cookie.  So I would expect to see to startTimeP8D entry for each setCookie event, not a different value.
         The result of the failed computation is shown on the bottom of the page.  As you can see, the Total Elapsed Time is negative, which is never a good sign.  The other time shown, Page build time, is the run time from the server.  The whole purpose is to be able to show folks that the reason the code might be show is because of their overloaded network and not our code.  We had one client whose had users running on 56k modems.  It was so slow their VPN software was timing out!!!  Still the had the never to blame us!!!
    I am using SQLServer 2005, CF8, IE8 on W7. 
    I'm not married to this way of doing this so if anyone has a better/easier way of doing a "page to page timer", I'm up for it.  I'd prefer to fix this one since I've been working on it for the past 3 days.
    Thanks in advcance for your help.
    Len, PHRED SE

    Here it is with no JQuery or console logging calls using cookie utility functions found here:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
           "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
         <title>Test JavaScript Page Load Timer</title>
         <script>
              window.onload = function(){
                   var previousPageUnload = getCookie('unloadTime');
                   if(previousPageUnload){
                        var d = new Date();
                        var loadTime = d.getTime() - previousPageUnload;
                        alert(loadTime + 'ms');
              window.onunload = function(){
                   var d = new Date();
                     setCookie('unloadTime',d.getTime());
              function setCookie(c_name,value,expiredays) {
                   var exdate=new Date();
                   exdate.setDate(exdate.getDate()+expiredays);
                   document.cookie=c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
              function getCookie(c_name) {
                   if (document.cookie.length>0) {
                     c_start=document.cookie.indexOf(c_name + "=");
                     if (c_start!=-1)
                       c_start=c_start + c_name.length+1;
                       c_end=document.cookie.indexOf(";",c_start);
                       if (c_end==-1) c_end=document.cookie.length;
                       return unescape(document.cookie.substring(c_start,c_end));
                   return null;
         </script>
    </head>
    <body>
         <h1>Test JavaScript Page Load Timer</h1>
    </body>
    </html>
    Note that overwriting global window events like this is not a good idea, which is why I used JQuery in my earlier example. I strongly suggest you look at JQuery or one of the other JS libraries (YUI, etc.) to help with event handling. I'll leave it at that as this is getting into JavaScript development, not really on topic for a ColdFusion forum.

  • Using Quicken to manage a bank account, I get an error message from the bank that cookies and javascript must be enabled, but I don't get that message when I connect with Internet Explorer.

    Firefox allows me to get the bank home page through Quicken. But when I try to login, the error message appears saying "cookies and javascript" must be enabled. I have Java on my system, but in Firefox under "tools/options/ I don't find any way to "enable" javascript. I have enabled "cookies".
    I have no problem logging in at the bank site using Internet Explorer, but to use it, I have to designate it as the "default browser" before connecting through Quicken. I'd rather keep Firefox as the default.
    A bank tech representative was unable to find any commands in Firefox that would deal with this problem, although she clearly had manuals for both Internet Explorer and Firefox. So she concluded that I would have to use Explorer for this operation, since it allowed control of security level settings. She said that in Explorer, security level should be set to medium.
    Is there some similar control in Firefox?

    Firefox uses the same "security level" setting that is set in IE.
    Tools > Options > '''Content''' <br />
    Is '''Enable Javascript''' check-marked?
    http://kb.mozillazine.org/JavaScript_is_not_Java
    If that doesn't solve your problem, do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • When trying to get onto my email, the following statement comes uip: "We are sorry, but you will need to enable cookies and Javascript to use your Username with this site. I click "here" but nothing happens. How do I enable cookies amd Javascript?

    Trying to get t my email, this comes up: We are sorry, but you will need to enable cookies and Javascript to use your Username with this site.
    How do I do this?
    George Szanto<br />
    [email protected]

    see similar question answered at https://support.mozilla.com/questions/836913
    To be notified of updates to a question whether it is your problem or not simply click on the "Get email notifications" and follow directed choice. Only the original poster can mark as solved, so there should be a slight difference in choice as an original poster and where you latch onto another question. The notifications only apply to the specific question where entered.

  • Any tutorials on creating a simple Login using Mysql and sessions?

    Hey guys. I cannot seem to find any information(online) or books that cover sessions in JSF and how to do a simple log in. I can get the application to query a mysql table and check the credentials and go to the next page, but I'm not sure how to make that page locked from non authorized access. I am very familiar with PHP and using it to create database driven applications. It's very straightforward, making safe logins using mysql, and creating sessions once the user has logged in(making pages locked unless the user is logged in, etc).. I have the core java server faces book but it's a joke. I feel like its an incomplete book. It merely skims a topic, and when you think it's going to get interesting it moves on to something else. It teaches basic stuff but nothing of what I want to do(or need to do). The older Javaserver faces book that came out in 2004 from O'Reilly doesn't seem to help either. I'm just wondering where people learn JSF at. I know Java, I would say pretty well as far as desktop applications go. I really like the way JSF is layed out and would really like to use it in my next project. At the level I know it now it's perfect for static web pages with no dynamic information.(but I could use plain html for that). Thanks for all your help.

    dothedru22 wrote:
    but I'm not sure how to make that page locked from non authorized access.You can use a Filter for that. Map the filter on the desired url-pattern and write doFilter() logic which checks if the user is logged in (basically: if there is an User object in the HttpSession) and handle accordingly (chain.doFilter() on success or response.sendRedirect on fail).
    and creating sessions once the user has logged in(making pages locked unless the user is logged in, etc).. The HttpSession is backed by a cookie (as is PHP's $_SESSION, did you know that?), you don't need to do any low-level stuff with cookies. Maybe at highest if you ever want a "remember me on this computer" option.
    booksThe mentioned books learns you the JSF basics. They doesn't really learn the best practices / practical use cases. There you have other resources for (or just practical experiences). Besides, I recommend you to go get a book which covers JSF 1.2 or newer. The mentioned ones are outdated, as is everything else older dan two years in the programming world.

  • Using CSS and Javascript to display a div with flash in it, mozilla reloads the flash file!

    I am using CSS and Javascript to display a div with an
    embedded flash object in it. Mozilla Firefox reloads the flash file
    when the div is displayed! (I dont want this to happen, as it's
    unexpected functionality, my expectation would be that the flash
    file would not change it's state at all, and would remain in
    whatever state it was left in.)
    I was wondering if anyone has come across this issue and is
    there something I can do to prevent this from occurring?
    To be more specific, I have a single HTML page with 8 flash
    files embedded in it (yeah I know, it's a bit much). I am then
    using CSS and Javascript to display (via a numbered link (with an
    id)) an equivalent numbered div tag containing the flash file.
    Mozilla Firefox reloads the flash object that is in the div.
    Internet Explorer will not do this and will instead, load the flash
    object only upon initial view of the flash object. All subsequent
    links (in IE) will NOT reload the flash object on the page. I'm
    guessing this is some kind of difference in the flash player as an
    Active X object and the plugin, or is it just IE being clever? Or
    am I way off?
    Anyway, here is the code...

    I am using CSS and Javascript to display a div with an
    embedded flash object in it. Mozilla Firefox reloads the flash file
    when the div is displayed! (I dont want this to happen, as it's
    unexpected functionality, my expectation would be that the flash
    file would not change it's state at all, and would remain in
    whatever state it was left in.)
    I was wondering if anyone has come across this issue and is
    there something I can do to prevent this from occurring?
    To be more specific, I have a single HTML page with 8 flash
    files embedded in it (yeah I know, it's a bit much). I am then
    using CSS and Javascript to display (via a numbered link (with an
    id)) an equivalent numbered div tag containing the flash file.
    Mozilla Firefox reloads the flash object that is in the div.
    Internet Explorer will not do this and will instead, load the flash
    object only upon initial view of the flash object. All subsequent
    links (in IE) will NOT reload the flash object on the page. I'm
    guessing this is some kind of difference in the flash player as an
    Active X object and the plugin, or is it just IE being clever? Or
    am I way off?
    Anyway, here is the code...

  • Cookies and Javascript enabling

    Looking for instructions on enabling cookies and javascript on my IMAC.
    Can anyone please provide quick instruction ?

    By default, both should already be enabled. To check, open Safari's preferences. Under the Security tab, Enable JavaScript should already be checked. Under the Privacy tab, Allow from websites I visit is the default, and should already be the radio button choice.

  • HT201441 this is bullshite again, i just updated the phone my partner gave me and now is locked and he doesn't remember ever using icloud and all my icloud accounts are not working, *** what's this now Apple ? good idea to secure us but seriously many wil

    this is bullshite again, i just updated the phone my partner gave me and now is locked and he doesn't remember ever using icloud and all my icloud accounts are not working, *** what's this now Apple ? good idea to secure us but seriously many will have t

    If your device is disabled...
    Connect to your computer in recovery mode per the instructions in http://support.apple.com/kb/HT1212
    You may need to do this more than once.

  • Website tell sme to enable cookies and Javascript when it is already enabled

    it concerns banking information...when I try to get into my bank account a window opens that tells me to enable cookies and Javascript when they are already enabled. This happens in both Firefox and Flock. I have tried unchecking them and then checking them but it doesn't work.
    == This happened ==
    A few times a week

    EXACTLY

  • Login using j_security_check and redirect to a jspx.

    I have a login.html file and created a form with two input fields for username and password. When I submit the form using a button, it posts 'j_security_check'.
    After successfull login it takes me to welcome page defined in web.xml. I have specified index.html file as welcome page and added a redirect on index.html to get redirected to adf faces page.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
    <meta http-equiv="refresh"
    content="0;url=./faces/Dashboard" />
    <title>Portal Home</title>
    </head>
    <body></body>
    </html>
    Its workig fine but now we want to have two dashboards and user should get redirected to one of them depending on his role. For example if user has 'HR' role he should be redirected to HRDashBoard and if he has manager role he should be redirected to ManagerDashboard.jspx.
    I tried using bean call from html but I think its not possible. How to do it?

    Our usecase is slightly different.
    We have login.html and not login.jspx, which we can put on adfc-config.xml file. login.html is provided by some other team so we can not create our own jspx.
    I have put router thing in adfc-config.xml but problem is 'How to call router activity from index.html' file. In index.html I can point url to any view-activity of adfc-config but I can't point it to a router activity of adfc-config.
    Now the problem is 'From index.html, redirect in such a way so that unbounded flow adfc-config.xml starts from a router activity.'
    Thanks
    Sanjeev

  • Using facelets and javascript in dynamic regions

    Hello
    I'm using JDeveloper 11g 11.1.1.4.0.
    In the JDeveloper's documentation I found that there is the best parctice to use facelets.
    Now, I have next problem.
    I use dynamic region iside xhtml (facelets) page. Inside that dynamic region there is a view (jsff).
    The problem is that I can't use any custom JavaScript in that jsff.
    I tried next thing:
                <trh:script id="trhs1">
                    <af:resource type="javascript">
                      testm = function (event) {
                      alert('qqq');
                    </af:resource>
               </trh:script>
    <af:clientListener method="testm" type="dblClick"/>If that task-flow is placed inside jspx (not facelets) page, then all works.
    If that task-flow is placed inside xhtm (facelets) page, I have an error from browser that javascript's 'testm' method is not defined.
    I checked source code of the result html-page, and my javascript code really doesn't exists there.
    I can fix it by moving javascript code from the taskflow's jsff to surrounding xhtml page or using jspx page, but, maybe, there is another solution?
    Anatolii
    Edited by: Anatolii. on 11/4/2011 0:32

    Thank for replay, Shay
    I found that in Web User Interface Developer's Guide for Oracle ADF, 2 Getting Started with ADF Faces, Section 2.4, "Creating a View Page":
    Best Practice: Use Facelets to take advantage of the following:
    The Facelets layer was created specifically for JSF, which results in reduced overhead and improved performance during tag compilation and execution.
    Facelets is considered the primary view definition technology in JSF 2.0.
    Some future performance enhancements will only be available with Facelets
    Now I have facelets page with dynamic region, it works.
    I've decided to use facelets because of the forthcoming JDeveloper with JSF 2.0 and for performance improvements described above.
    Do you think it's better to use jspx?
    I have not found any limitations for facelets in Web User Interface Developer's Guide for Oracle ADF and Fusion Developer's Guide for Oracle ADF
    Anatolii

  • Error using java and javascript

    I have a jsp page that links to a bean and is working fine (getting data from the database).
    On a html form I have a button with a picture that fires off javascript when clicked:
    <BUTTON TYPE=reset onclick=showinfo('<%=index%>')>
    <IMG SRC="http://localhost:8080/Portal/Images/q2.bmp" ALT="Info">
    </BUTTON>
    The javascript function just opens a new window and displays the text sent in:
    <Script Language=JavaScript>
    function showinfo(arrayindex)
    InfoWin=window.open("","InfoWin","width=345,height=220");
    InfoWin.document.write(arrayindex);
    return false;
    </Script>
    Well in the above example index is a number (pulled from the database using a java bean and javascript converts it into a string then the function displays it correctly. If I replace <%=index%> with regular text it works fine as well(because java isn't used to pull data)! The problem occurs when I retrieve text data from the database and send it to the function. The web page gives errors about a nonterminating string. But I can move the code to somewhere else on the form(as long as I don't send it to java script) and it will print the text to the screen. I can also view the source of the web page and the html shows the text from the data base as if I hard coded the text into the javascript!!!!!!!!!!!!!!!!!
    This must be a bug between java and javascript!
    -can pass numbers(from a database) between the two
    -can't pass text (from a database)between the two
    Any info would help!

    Found the problem myself!
    I am using an odbc connection to msaccess and the spaces in the text was messing things up!
    After taking out the spaces it worked again.

  • Auto-login using cookies

    I have been prototyping and researching Weblogic authentication for several weeks
    now. With a form-based login servlet, how would one implement auto-login? Basically,
    the web site is supposed to set a persistent cookie which contains the users login
    information (encrypted). When the user comes back, they should be logged in automatically.
    This seems like a pretty common concept, but totally unsupported by J2EE. I have
    looked into using filters, but ran into several problems. First, filters don't
    get executed on a protected resource unless the user is authenticated. I don't
    want to use Weblogic's AuthFilter since it's deprecated. Secondly, I tried modifying
    my login servlet to forward to j_security_check. That doesn't work because Weblogic
    won't let you. There is a workaround for that, but j_security_check ignores whatever
    wrapper you put around HttpServletRequest. This makes it impossible to "login"
    for the user. Third, I tried using ServletAuthentication.weak() to manually authenticate
    the user, but how do I redirect the user back to the intended URL? I figured
    out where Weblogic stores the URL in the HttpSession, but that's not officially
    documented.
    I noticed some references in Weblogic's Portal product that it supports auto-login.
    However, I haven't figured out how to do it myself in a Weblogic server.
    I am using Weblogic 7 sp2. Thanks in advance.

    Chun,
    what you need to do is to implement is a Perimeter Authentication. I did that
    successfully with SP2. You have to use SP2, because in SP1 there qas no way to
    supress that all cookies are BASE64 decrypted.
    What helped me a lot is to study SampleSecurityProvidersUnmanaged.zip that you
    can download from
    dev2dev/code
    Enjoy!
    Cheers.
    Frank
    "Chun Hsu" <[email protected]> wrote:
    >
    I have been prototyping and researching Weblogic authentication for several
    weeks
    now. With a form-based login servlet, how would one implement auto-login?
    Basically,
    the web site is supposed to set a persistent cookie which contains the
    users login
    information (encrypted). When the user comes back, they should be logged
    in automatically.
    This seems like a pretty common concept, but totally unsupported by J2EE.
    I have
    looked into using filters, but ran into several problems. First, filters
    don't
    get executed on a protected resource unless the user is authenticated.
    I don't
    want to use Weblogic's AuthFilter since it's deprecated. Secondly, I
    tried modifying
    my login servlet to forward to j_security_check. That doesn't work because
    Weblogic
    won't let you. There is a workaround for that, but j_security_check
    ignores whatever
    wrapper you put around HttpServletRequest. This makes it impossible
    to "login"
    for the user. Third, I tried using ServletAuthentication.weak() to manually
    authenticate
    the user, but how do I redirect the user back to the intended URL? I
    figured
    out where Weblogic stores the URL in the HttpSession, but that's not
    officially
    documented.
    I noticed some references in Weblogic's Portal product that it supports
    auto-login.
    However, I haven't figured out how to do it myself in a Weblogic server.
    I am using Weblogic 7 sp2. Thanks in advance.

  • How can i remove the cookies and javascript?

    Welcome to "Game of Moans," the weekly recap of "Game of Thrones" Season 4 that highlights all the moan-worthy, gasp-filled, OMG moments that litter the Seven Kingdoms. In other words, you can get a traditional recap anywhere, so here's all the sex, bloodshed, and WTF moments (the good stuff) that went down this week:
    (Spoiler alert for "GoT" Season 4, Episode 9 "The Watchers On the Wall." Warning: Some images below show very graphic violence.)
    <a href="">Watch Game of Thrones Season 4 Episode 9 Online</a>
    <a href="">Watch Game of Thrones Season 4 Episode 9 Online Free</a>
    June 8's "The Watchers On The Wall" served up 35 minutes of non-stop bloody, nerve-wracking action as the Wildlings arrived at Castle Black to fight the Night's Watch. While Jon Snow can definitely kick some ass with his sword fighting skills, an unlikely hero emerged in this episode. Sam Tarly, previously the most naive and timorous character on the show, finally manned up by not only killing a Wilding, but by protecting his woman, getting his first kiss, and showing way more courage and wisdom than we ever could've expected. This was your night, Sam.
    The Watch-Out-For-The-Giant Moan
    The Wildlings didn't just bring way more men than the Night's Watch, they brought giants, and even giants sitting atop elephants! Giant Number One got really pissed off that his buddy Giant Number Two got killed. So he casually shot an arrow up towards the wall, hitting a guy and literally making him fly backwards off of the wall, landing on the ground below. Ouch.
    As I said above, it was a surprise to see Sam finally all grown up and matured. He gave his friend an honest pep talk, held him in his arms as he died and didn't flee from battle, as he would've unquestionably done before. His best moment came when, instead of cowering under the Thenn charging at him, he loaded up his crossbow and -- BAM! Samwell Tarly killed a live human, and it was a massive terrifying dude. (I literally clapped and cheered in this victorious moment.)

    As much as I agree with you that this weeks episode was spectacular, I also recommend reading the books, this is not a support question. If you do have a support question please start a new thread.
    If the above information does not resolve your issue, please consider creating a new thread containing the specific details of your issue.
    Doing so will allow the Mozilla volunteers to give you solutions that are more helpful to you. This may help them to solve your problem faster and more efficiently.
    Please, feel free to post the link to your thread on this thread for volunteers interested in assisting you.
    Thank you.

  • Make a read-only text field open by using button and javascript

    Hello
    I have a form with text fields that I will pre-populate with data. The text fields will be read-only by default. I want to make it so that when a user wants to make edits, he will need to click on a button and in turn, the text field's background will turn gray and he can make edits to the text field. I can already make the background turn gray but I cannot make the text field open.
    This is the code that will run after the button is clicked:
    color.ltGray = new Array("G", 0.75);
    this.getField('TestField').fillColor = color.ltGray;
    this.getField('TestField').access = "open";
    The text field's background turns gray but it is still read-only. Any ideas?
    Thanks in advance!

    Here's the online version of the Acrobat JavaSript documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhel p.htm?href=JavaScript_SectionPage.70.1.html&accessible=true
    It's also available as a PDF in the Acrobat SDK.
    Regarding your other question about adding a PDF to another, do you want to add it as an attachment, or add the pages from one PDF to another?

Maybe you are looking for

  • Getting values from a domain

    Hi! When I enter fix values into a domain, it is appearing automatically through the data element in an element of a view (like a dropdown by key). That's nice, it is working perfectly. However if I don't use fix values in the domain, but I use a val

  • One Computer - Two iPod Touches - Multiple Apple ID's possible?

    Can you have multiple Apple ID's on one computer with one iTunes account so that more than one iPod Touch can activate Face Talk and email?

  • How do i sort out iTunes library into order and the out repeated songs

    I need too sort out my itunes library its a mess repeated songs and all over the place is there an easy method?

  • WebDynpro development in GP: only WD java ?

    Hi,   I want to develope a custom webdynpro component that can be used as a callable object, may i choose Webdynpro for ABAP as the development tool? I noticed that in some tutorial that certain APIs are necessary to develop webdynpro component, does

  • New macbook with pixel problem

    I purchased a new macbook and this was my first. I switched from PC to Mac . I have to say I am a little disappointed. I got one burned pixel that doesn't work, warranty doesn't cover this (since it's only one) and there is no compensation for that.