Question on Javascript

Can someone please tell me if I can save the user input data to a file using Javascript.
Also, if i can read the data from a file in javascript?
Thanks for your time and effort

Maybe you should read this
http://www.javascripter.net/faq/reading2.htm
regards
Sho

Similar Messages

  • How do I know quiz results per question using Javascript

    We have some quizzes in Captivate and we would like to extract quiz results per question so that we know which question the user did correct and which one was incorrect. The requirement is that we do not want to code inside Captivate as the Captivate movies are provided by the users, so all code needs to be done would be in Javascript on the HTML page.
    Any ideas are welcome.
    Thank you
    Kirmani

    Have a look at Jim Leichliter's blog site. Lately he published a video course about using JS in Captivate, that could be useful.
    http://captivatedev.com/2014/01/02/javascript-video-series-adobe-captivate-7/
    Lilybiri

  • Quick Question About Javascript Code

    I'm trying to write some code in JavaScript so that a different image will display every time someone loads my homepage. I have come across a section called
    'imgct' what does "ct" stand for?
    Please excuse the stupid question but this is my first time!
    If anyone could point me in the right direction of how to do this aswell I would be extremely grateful!
    Thanks
    Kyra

    I'm so sorry about this, it just doesn't seem to be working, I did what you suggested but it still doesn't show up in my browser. :S
    The is the code view of my page now:
    <!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=utf-8" />
    <title>Untitled Document</title>
    <link href="Style_sheet.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    homeImg = newArray(
    "Images/Homepage/Image1.jpg",
    "Images/Homepage/Image2.jpg",
    "Images/Homepage/Image3.jpg",
    "Images/Homepage/Image4.jpg",
    "Images/Homepage/Image5.jpg"
    ImgCt=homeImg.length;
    function swapImg() {
        if (document.images) {
            randomNum=Math.floor((Mathrandom()*ImgCt));
            document.images ["homePicture"].src = homeImg[randomNum];
    window.onload = swapImg()
    </script>
    </head> 
    <body>
    <div class="container">
      <div class="header">
    *//There is a spry menu bar that goes here//*
        <!-- end .header --></div>
      <div class="content">
      <img src="" name="homePicture" width="627" height="250" id="homePicture" /> </div>
      <noscript><img src="Images/Homepage/Image2.jpg"/></noscript>
    As you can see I have also tried to add in a 'noscript' tag incase someone doesn't have javascript enabled etc. although when I preview it in IE I see both 'Image2' and the image placholder where teh random image is meant to appear, but doesn't.
    I'm very grateful for all the help you are giving me!
    Thank you
    Kyra

  • ADF Question: call javascript function from backing bean?

    Hi all,
    I am running JDeveloper 10.1.3.3 with ADF BC.
    Heres my situation:
    I have a table, and after inserting a new row, then committing, I want to call a javascript function. I tried using the onkeyup javascript to force a click of the save button, and then call my function after that. However, I really only want the second function to be called AFTER the commit has occurred.
    I have tried putting a setTimeout on the second function, but this never executes then. Is there some way that I can call the second javascript function from the backing bean? Is there a better workaround for this? Here is some code:
            function submitCreate(e) {
                var _event = (window.event) ? event : e;
                var KeyID = _event.keyCode;
                switch (KeyID)
                    case 13:
                        document.getElementById("form1:tvoTable:commitButton").onclick();
                        doAjax();
                        break;
            function doAjax() {
                var item = document.getElementById("form1:inputText3").innerHTML;
                getAjax(item, "FULL");
            }Thanks,
    Heather

    Maybe try adding an af:script block in your jsp as a partial target in your backing bean when you commit to the database? We are doing something similar when we get a tab DisclosureEvent but the principle should be the same.
    In our jsp we have:
    <af:script id="scriptID" text="alert('javascript here');"/>
    In the backing bean we have:
    method(DisclosureEvent de) {
    // get a component somehow or the component, we get it from the disclosure event
    // but you could use a binding also. if you don't have the exact script element you need
    // to find it like we do below.
    UIComponent c = de.getComponent();
    // Find our real script component
    UIComponent target = c.findComponent(":scriptID");
    // get the adf context
    AdfFacesContext adfContext = AdfFacesContext.getCurrentInstance();
    // add the script as a partial target.
    if(target != null) {
    adfContext.addPartialTarget(target);
    This relies on PPR though, which you may not be doing. If you are navigating to a new page you could set an indication in a backing bean and then access that in an <af:script> block in the new page or even generate the Javascript you want depending on your logic and access all of it via an EL binding on the af:script tag:
    <af:script id="scriptID" text="#{bbean.generatedScript}"/>
    Hope this helps!
    Steve

  • A question on Javascript

    Hello,
    I'm very new to javascript
    My simple script goes :
    <script language ="javascript" >
         str1="Hello! ";
         str2 ="World.<br>";     
    /*line1*/     document.write((str1 + str2).big());     
    /*line2*/     document.write(str1.concat(str2).italics());
    /*line3*/     document.write((str1+=str2).fontcolor("blue"));
    </script>
    I know this will produce an output of Hello! World 3x...
    but why is it if I write the code by shuffling the lines 1 with 3, my out put makes an extra output.
    it will comeout as
    Hello! World.
    Hello! World.
    Hello! World.
    World.// I have this extra thing comming out
    Can you please help me :D
    Thanks in advance ,
    April

    Javascript isn't Java. Those swell guys at Netscape (God rest its soul) decided to give Javascript a similar name, for no good reason, thus causing plenty of confusion.
    You're more likely to get a useful answer at a forum specifically about javascript.
    But anyway, probably the "+=" operator (if it's like += in javascript, perl, C, etc.) modifies the value on the left of the operator. So after your third write, str1 is now "Hello! World<br>". So if you then write "str1 + str2", you'd produce "Hello! World<br>World<br>".
    That's my theory, anyway.

  • A question about javascript

    I want to print a particular webpage without its header and footer. But when i tried window.print(); the result is disappointing! So is there any way to remove the header and the footer of the webpage?
    Thanks!

    You might be better off going to this link one has alot of scripts and the other is a javascript forum good luck
    http://forums.internet.com/WebX?14@^[email protected]
    http://forums.internet.com/WebX?14@^[email protected]

  • Question about Javascript?

    'm trying to implement some stuff and am having some trouble.
    Here is a good example of what I want to do.
    http://www.huffingtonpost.com/
    Huffingtonpost
    On the right side of the page a little bit down is a section
    called "MOST POPULAR ON HUFFPOST" is a list of links, when you
    click on a link the page grays out with a synopsis of the story.
    What I want to do is a bit more simple, I just want the page to
    gray out with a list of links. If anyone knows how to do this give
    me a heads up. I'm pulling my hair out trying to find out. I
    inspected the element in safari webkit and this is what it showed.
    <a
    href=http://www.huffingtonpost.com/2008/02/28/miley-cyrus-drinks-ketchu_n_88898.html
    onclick="return QV.pop(this);">Miley Cyrus Drinks
    Ketchup</a>
    I placed in bold what I think is causing this action but
    don't know how to implement this.
    Thanks in advance

    Thanks for the feedback, Dave. I'll see if I can increase the
    transparency
    on that background image.
    It's fast because it's just loading text rather than fetching
    an upsized
    image....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Baxter" <baxter(RemoveThe :-)@gtlakes.com> wrote in
    message
    news:[email protected]...
    > Murray
    > I like your approach much better as there is no
    distraction and much
    > faster
    > loading, How ever I have to say I closed the box soon
    after it opened
    > because the text is so hard to read over that background
    image (like
    > trying
    > to read a wet news paper) The photos are very beautiful
    though.
    > Dave
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:[email protected]...
    >> Go here -
    http://www.huddletogether.com
    - and read about lightroom.
    >>
    >> I have implemented something similar here -
    >>
    http://www.kolkinphotography.com/portfolio/
    - and click on one of the
    > "about
    >> the series" links.
    >>
    >> --
    >> Murray --- ICQ 71997575
    >> Adobe Community Expert
    >> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >> ==================
    >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >> ==================
    >>
    >>
    >> "qcb" <[email protected]> wrote in
    message
    >> news:[email protected]...
    >> > 'm trying to implement some stuff and am having
    some trouble.
    >> >
    >> > Here is a good example of what I want to do.
    >> >
    >> >
    http://www.huffingtonpost.com/
    >> >
    http://www.huffingtonpost.com/
    >> >
    >> > On the right side of the page a little bit down
    is a section called
    > "MOST
    >> > POPULAR ON HUFFPOST" is a list of links, when
    you click on a link the
    > page
    >> > grays out with a synopsis of the story. What I
    want to do is a bit more
    >> > simple,
    >> > I just want the page to gray out with a list of
    links. If anyone knows
    >> > how to
    >> > do this give me a heads up. I'm pulling my hair
    out trying to find out.
    > I
    >> > inspected the element in safari webkit and this
    is what it showed.
    >> >
    >> > <a
    >> >
    >
    href=http://www.huffingtonpost.com/2008/02/28/miley-cyrus-drinks-ketchu_n_88
    > 898.
    >> > html onclick="return QV.pop(this);">Miley
    Cyrus Drinks Ketchup</a>
    >> >
    >> > I placed in bold what I think is causing this
    action but don't know how
    > to
    >> > implement this.
    >> >
    >> > Thanks in advance
    >> >
    >>
    >
    >

  • Is it possible to embed some JavaScript code WITHIN a QT movie?

    Hi,
    This may be a job for QuickTimeKirk, as I've seen (s)he seems quite knowledgeable about QuickTime secrets...
    I'm using a blog service which does not allow the calling of external JavaScript files. Furthermore, testing STAMPot from my excellent fellow compatriot *Francis Gorge* (http://www.qtbridge.com/stampot/stampot.html) did not help me enough because the posts on my blog are contained within tables over which I have little control. In particular, I cannot write a full HTML page description with the <head> and <body> tags, and all the references needed to link to the .js file (and others) created by STAMPot.
    So, I'm wondering if it is possible to embed the appropriate code directly within a QuickTime movie, e.g. under the form of a additional HREF track.
    What I'm trying to achieve, in the end, is to have a poster frame for my movie, and have the movie play within that same poster frame space, but WITHOUT the movie controller +(not the poster frame controller, which I know how to hide)+, and then the movie looping back to the poster frame.
    Maybe I missed something, but in the case I understood correctly what I read on the QT Dev web site, when one passes the controller="false" parameter to the +<embed src="<a class="jive-link-external-small" href="http://...&gt;">http://...> tag, the parameter only applies to the FIRST movie, which is, in fact, the poster frame. Even if the target movie was saved with the controller disabled, this is only acknowledged by QuickTime Player, NOT by the QuickTime plugin.
    Any help will be greatly appreciated!
    Thanks in advance,
    batspray

    1- You can add a frame to the end of the movie, make it an href track that points back to the poster movie. Yes. Illustrated details, here: [http://developer.apple.com/documentation/QuickTime/QT4WebPage/samplechap/speci al-24.html]
    2.- As to the larger question of JavaScript within the QT movie, No. "Starting with QuickTime 7.1.5, you can no longer issue javascript: URLs or call JavaScript functions from within a QuickTime movie. This feature was removed from QuickTime for security reasons." See this official notice: [http://developer.apple.com/documentation/quicktime/Conceptual/QTScriptingJavaScript/bQTScripting_JavaScri_Document/chapter_1000_section1.html].

  • JavaScript - Error: The security validation for this page is invalid...

    Hi there,
    I have a question regarding javascript and the security validation.
    I have created a custom action for a document library. This custom action should update a field in all selected documents by the user. But when I do the update, I got this error message:
    "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again."
    I know, I could AllowUnsafeUpdates, if I were using C#, but actually I can only use JavaScript at this stage. Or does anybody know, how to allow this or switch to C# in this area?
    Here is my custom action:
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="GrolmansJavaScriptFile"
    ScriptSrc="~site/_layouts/SharePoint-Z-Drive-Project/gg1855.js"
    Location="ScriptLink">
    </CustomAction>
    <CustomAction
    Description="Approve Documents"
    Title="Approve Documents"
    Id="RibbonDocumentsManageApproveDocuments"
    Location="CommandUI.Ribbon"
    RegistrationId="10000"
    RegistrationType="List"
    Sequence="0"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Define the (UI) button to be used for this custom action -->
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.Documents.Manage.Controls._children">
    <Button Id="Ribbon.Documents.Manage.ApproveDocuments"
    Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}"
    Image32by32="~site/_layouts/Images/SharePoint-Z-Drive-Project/approve_document_32x32.png"
    Image16by16="~site/_layouts/Images/SharePoint-Z-Drive-Project/approve_document_16x16.png"
    Sequence="0"
    LabelText="Approve Documents"
    Description="Approve Documents"
    TemplateAlias="o1" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- Define the action expected on the button click -->
    <CommandUIHandler Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}" CommandAction="javascript:void(ApproveDocuments());" />
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    </Elements>
    And here is my JavaScript code file:
    function ApproveDocuments()
    var siteUrl = '/';
    var clientContext = new SP.ClientContext(siteUrl);
    var currentlibid = SP.ListOperation.Selection.getSelectedList();
    var currentLib = clientContext.get_web().get_lists().getById(currentlibid); //Gets the current Library
    var selectedItems = SP.ListOperation.Selection.getSelectedItems(clientContext);
    for (var i in selectedItems) {
    currentLib.getItemById(selectedItems[i].id).set_item('DocumentStatus', 'Approved');
    currentLib.getItemById(selectedItems[i].id).update();
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded()
    alert('Document approved:' + newListItem.get_id());
    function onQueryFailed(sender, args)
    alert('Document approval failed: ' + args.get_message() + '\n' + args.get_stackTrace());
    Any idea, how to perform the update on the selected items?
    Thanks for any hint.
    Dennis

    Ok, I found the reason. 
    I just had to replace the SP.ClientContext line in JavaScript.
    Instead of
    var clientContext = new SP.ClientContext(siteUrl);
    I need to use this one:
    var clientContext = SP.ClientContext.get_current();
    Dennis

  • How can i get the item of combobox in javascript LCD?

    Hi!
    I have a question about javascript in LCD i want to get or assign the item value of a combobox because i need to mapping and i´ve tried using the option
    form1.Page.Contenedor.RadioBtn.rbTipo[1].caption = "nuevotexto";
    form1.Page.Contenedor.RadioBtn.rbTipo[1].rawValue = "nuevotexto";
    and more... but i don´t know if that is possible, could someone help me?
    thank's

    Hi,
    I think you are trying to set the value of a radio button group(???).
    If so, then you first need to look in  the Object > Binding palette to set the bound values.
    Then you can set the value of the radio buttons by referencing the exclusion group and not an individual radio button.
    If you have three radio buttons in an exclusion group 'RadioBtn' and they had bound values of '1', '2' and '3'. Then the following script would select the second button in the group:
    form1.Page.Contenedor.RadioBtn.rawValue = "2";
    If I have picked up your query wrong, then come back with some more info.
    Niall

  • Javascript

    Hello,
    I've noticed that some people get upset when someone mentions javascript in this forum. Is there another forum where I could ask questions on javascript? Thanks.
    To those who don't get upset, here is my question:
    With these items: a button, a select box (list/menu), and a form.
    <form name="form2" action="">
    <select name="selected" size="2">
    <option value="blah1" >This is blah1</option>
    <option value="blah2" >This is blah2</option>
    </select>
    <input type="button" name="moreInfo" value="View more info" onClick="openInfoWindow();'">
    </form>
    <script language="javascript>
    function openInfoWindow() {
    var blah= //HOW DO I ACCESS THE HIGHLIGHTED SELECTION THE USER MADE?
    window.open("infoWindow.jsp?selected="+blah,"someNewWindowName");
    </script>
    Thanks in advance!

    <script language="javascript">
    function openInfoWindow() {
    //HOW DO I ACCESS THE HIGHLIGHTED SELECTION THE USER MADE?
    var blah=  document.form2.selected
    for(var i = 0; i < blah.length; i++) {
         if ((blah.options[i] != null) && (blah.options.selected)) {
              alert(blah.options[0].text) // .value if you need value
    window.open("infoWindow.jsp?selected="+blah,"someNewWindowName");
    </script>
    <form name="form2" action="">
    <select name="selected" size="2">
    <option value="blah1" >This is blah1</option>
    <option value="blah2" >This is blah2</option>
    </select>
    <input type="button" name="moreInfo" value="View more info" onClick="openInfoWindow();">
    </form>

  • JavaScript in Creator-projects

    Hello,
    I have a question about JavaScript. I have a page with two textfields, each 10 characters in length and below of each other.
    What I would like to achieve is the following:
    If a user enters one (or more) characters in one field, then the other field should be filled automatically with corresponding (but other) characters (it has to do with DNA-analysis).
    For example, if a user enters a 'C' in one field, then the other field should be updated with a 'G' and the other way round.
    Because the logic is quite simple, I think using JavaScript would be better than using AJAX. So does anybody know how to do this or where I can find some tutorial about JavaScript in Creator (I already searched the Creater-homepage and the blogs and couldn't find anything...)
    Thank you!
    Felix

    Can you further explain "did not work"? What are your symptoms, error messages? Is the browser not seeing your JavaScript or is there an error in your JavaScript that prevents the browser from executing it.
    Have you tried using your browser's debugger to determine where the problem is? Have you seeded the JavaScript with alert statements to find out what is working and what isn't?
    Not knowing exactly where you are running into trouble, I can only give out a couple of solutions. They may or may not fit your situation.
    o One way to insert JavaScript into a JSP file is to wrap it in
    <script><![CDATA[ & ]]></script> start and end tags. This ensures that the script makes it to the browser intact.
    o Here is one way to add a .js file and reference it from your page:
    # Assuming that your .js file doesn'ty already exist in the web folder...From the main menu choose File > Add Existing Item > Other (All Files).
    # Navigate to and select your .js file
    # Click Add.
    The IDE puts the file under he Source Packages > <project> folder. In the next step, you move the file to the web folder.
    # In the Projects window, right-click the Source Packages > <project> > <your file>.js node and choose Cut from the pop-up menu.
    # Right-click the Web Pages node and choose Paste from the pop-up menu.
    # View your page in the Visual Designer.
    # Drag the Script node from the Advanced section of the Palette window and drop it on a blank spot on the page.
    # In the Properties window for the Script, click the url property's ellipsis (...) button, select your .js file and click OK.
    The .js will now be included in the JSP file for the page.

  • Ouput javascript array to .txt file

    My javascript program includes a 2D array and stores some information into this 50 * 20 array. I need to output this information into a .txt or any other format file.
    Does anyone know how to do that in javascript.

    And you want the JSP to do the outputting as it generates the javascript, or you want the javascript to do the outputting when it executes in the browser?
    I'm guessing it's the latter, as outputting something on the server would be a poor idea, and that would make it a question about javascript. Which I don't know the answer to. My guess is that javascript doesn't have the ability to write to files on the client because that would be a serious security hole, serious enough to make almost everybody disable javascript.

  • Passing parameter from Servlet to javascript in JSP. Very Urgent - 5 jukes!

    Well my servlet will retrieve questions from database.
    Then the player will answer the question in the JSP and submit the answer to the servlet to process.
    Each time an answer is submitted, or a "Next Question" button is clicked, the countdown time will restart.
    And will reload the page with a new question.
    So how can i do that?
    This is my servlet, JSP, javascript
    =====================================================================
    * Interacts with the player depending on his types of selection and output them
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class GameQuestionServlet extends HttpServlet
         String sSQL = null;
         String sCategory = null;
         String paramName = null;
         User userObject = null;
         Questions gameQsObj = new Questions();
         HttpSession session;
         int cnt = -1;
         int score = 0;
         boolean connected = false;
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              session = request.getSession(false);
              //System.out.println("Testing Score:" + score);
              if(connected == true)
                   Questions object = (Questions)gameQsObj.getQsList().elementAt(cnt);
                   System.out.println("\n" + object.sAns1);
                   System.out.println(object.sAns2);
                   System.out.println(object.sAns3 + "\n");
                   Enumeration enum = request.getParameterNames();
                   while(enum.hasMoreElements())
                        paramName = (String)enum.nextElement();
                        if(paramName.equals("mcq"))
                             System.out.println(request.getParameter("mcq"));
                             score = Integer.parseInt(userObject.score.trim());
                             System.out.println("Player old score: " + score);
                             //Check to see if the selected answer matches the correct answer
                             if((object.sCorrect).equals(request.getParameter("mcq")))
                                  score = score + 10;
                             else
                                  if((object.sCorrect).equals(request.getParameter("mcq")))
                                       score = score + 10;     
                                  else
                                       if((object.sCorrect).equals(request.getParameter("mcq")))
                                            score = score + 10;     
                                       else
                                            score = score - 10;     
              System.out.println("Player current score: " + score);
              else     //will only go into this once
                   userObject = (User)session.getAttribute("user");
                   System.out.println("\n"+userObject.nric);
                   System.out.println(userObject.name);
                   System.out.println(userObject.password);
                   System.out.println(userObject.email);
                   System.out.println(userObject.score+"\n");
                   //depending on user selection
                   sCategory = request.getParameter("qsCategory");
                   sSQL = "SELECT * FROM " + sCategory;
                   gameQsObj.getQuestions(sSQL, sCategory);
                   score = Integer.parseInt(userObject.score);
                   connected = true;
              System.out.println("Connected:" + connected);
              System.out.println("Before:" + userObject.score);
              cnt = cnt + 1; //increment to retrieve next question
              userObject.score = Integer.toString(score);     
              System.out.println("After:" + userObject.score);
              if(cnt < 3) //setting for the number of questions per game.
                   //request.setAttribute("qsCnt", cnt); //count of the question number
                   request.setAttribute("aQs", gameQsObj.getQsList().elementAt(cnt));
                   System.out.println(request.getAttribute("aQs"));
                   System.out.println("This is question number: "+ cnt);
                   getServletConfig().getServletContext().getRequestDispatcher("/JSP/PlayGame.jsp").forward(request, response);
              else
                   //forward to the result page     
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
    <%@ page import="Questions" %>
    <HTML>
         <HEAD>
              <TITLE>Play Game</TITLE>
              <SCRIPT LANGUAGE="JavaScript">
                   var refreshinterval=10
                   var displaycountdown="yes"
                   var starttime
                   var nowtime
                   var reloadseconds=0
                   var secondssinceloaded=0
                   function starttime() {
                        starttime=new Date()
                        starttime=starttime.getTime()
                        countdown()
                   function countdown() {
                        nowtime= new Date()
                        nowtime=nowtime.getTime()
                        secondssinceloaded=(nowtime-starttime)/1000
                        reloadseconds=Math.round(refreshinterval-secondssinceloaded)
                        if (refreshinterval>=secondssinceloaded) {
                   var timer=setTimeout("countdown()",1000)
                             if (displaycountdown=="yes") {
                                  window.status="You have "+reloadseconds+ " second before timeout"
                   else {
                        hide();
                   clearTimeout(timer)
                             //window.location.reload(true)
                   function hide() {
                        //hidelayer
                        if(gameLayers.style.visibility == "visible"){
                             gameLayers.style.visibility = "hidden"
                             oops.style.visibility = "show"
                   window.onload=starttime
              </SCRIPT>
         </HEAD>
         <BODY>
              <FORM METHOD="post" ACTION="http://localhost:8080/Java_Assignment2/servlet/GameQuestionServlet">
                   <DIV ID="oops" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:2; visibility:hidden">
                        Oops! 30 seconds time up!!! <BR><BR>
                        <INPUT TYPE="submit" VALUE="Next Question">
                        <INPUT TYPE="hidden" NAME="nextQs" VALUE="Next Question">
                   </DIV>
                   <DIV ID="gameLayers" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:3; visibility:show">
                   <TABLE BORDER="0">
                        <TR>
                             <TH><BIG>Questions:</BIG></TH>
                        </TR>
    <%
                        Questions aQsObj = (Questions)request.getAttribute("aQs");
                        String aQsBody = aQsObj.sQs;
                        String aQsAns1 = aQsObj.sAns1;
                        String aQsAns2 = aQsObj.sAns2;
                        String aQsAns3 = aQsObj.sAns3;
    %>
                        <TR>
                             <TD><B><%= aQsBody%></B></TD>
                        </TR>
                        <TR>
                             <TD>
                                  <SELECT SIZE="3" NAME="mcq">
                                       <OPTION SELECTED><%= aQsAns1 %></OPTION>
                                       <OPTION><%= aQsAns2 %></OPTION>
                                       <OPTION><%= aQsAns3 %></OPTION>
                                  </SELECT><BR><BR>
                             </TD>
                        </TR>
                        <TR>
                             <TD>
                                  <INPUT TYPE="submit" VALUE="Submit Your Answer">
                                  <INPUT TYPE="hidden" NAME="submitAns" VALUE="Submit Your Answer">
                             </TD>
                        </TR>
                   </TABLE>
                   </DIV>
              </FORM>
         </BODY>
    </HTML>
    This must be answered before 28th of september.
    Please help. It is indeed very urgent.

    this is just a skeleton code.. alot of stuff is not here..
    <FORM name = "form1" action="../servlet/wateverSevlet>
    <input type="text" name="searchStr" size="40">
    <INPUT type="hidden" id=answer name=answer size=7>
    <input type="button" name="button" value="Submit Answer" onClick="javascript:submitCheck(document.form1.searchStr.value);">
    <input type="button" name="button" value="Skip Question" onClick="javascript:submitCheck('skip');">
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    function submitCheck(str)
      form1.answer.value = str
      form1.submit()
    </script>i assuming you are submitting it to the same servlet regardless of whether the user clicks the skip question or the submit question button.

  • JavaScript function in Web Application Designer

    Hello,
    I have a question to JavaScript functions. I created in mime repository a javascript file with function HEADER() and a web template. Now I want to call this function in the web template. In the head I use following code:
    <script language="JavaScript" src="/sap/bw/Mime/Customer/JavaScript/Test_New_Button.js" ></script>
    In the body I use following code:
    <script type="text/javascript">HEADER();</script>
    If I execute this web template in the browser, nothing will be displayed. What could be the problem?
    Thanks for your help.
    Regards
    Anne

    Anne,
    It could be that the Javascript file cannto be accessed - check that - also have local code in the template and see if it works - also make sure javascript is not switched off -- some browsers allow you to do that..
    One more way to check the same is :
    Install theMicrosoft Script debugger <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99">microsoft Script Debugger</a>
    and see if the code is being called..
    Arun
    Hope it helps..

Maybe you are looking for

  • Clean Access Server could not establish a secure connection

    I have a OOB Real IP GW setup on v4.1.2 I seem to have a problem with the CAS connecting to the CAM although I have added the CAS to the CAM and can manage the CAS from the CAM. I noticed while troubleshooting client authentication that the client wa

  • SMB not working from outside the local network

    Hi guys.. I've set up a storage server so that users can log in remotely and access their files. I have two connections I want to use, AFP and SMB. The AFP connections work great. No matter where our mac users are, they can log in through the net and

  • Intrastat - Add fields in report output - VE01

    Hi Friends, I do not see import output  fields like mode of transport, COO, material No, etc in VE01 intrasta report output. Is there any configuration to add required output fileds. In the select laout also we do not have these fields except there i

  • MAP in Project stock

    hi Please confirm whether project stock is considered while calculating MAP. Regards ROC

  • New 80gb iPod works, but not shown as a disk drive... help!

    Hi, My brand new iPod is not show as a disk drive, even though it shows on iTunes, and has been updated, synchronized. Even after enabling disk use, it still isn't there. It is on the device manager, and it says that the device is working ok. I have