Simple javascript ?

I'm trying to find some simple code that will direct a user to a page based upon his or her selection. I have a hint and submit button. When one is pressed I want to redirect to a certain screen. I have code in vbscript not javascript using onClick. Can someone direct me or show me a simple function for this???
Thanks in advance.

I have tried the following code and have gotten an error of--- 403 /
The link you tried to access: /ITS/ is forbidden.
<script language="Javascript">
<!--
     function Submit()
          parent.location="/ITS/itsLoginhtml.jsp";
     function Password()
          parent.location="hint.jsp";
-->
</script>
and then on the bottom of the page --
<INPUT type=Submit Value="Submit" onclick="return Submit();">
&nbsp&nbsp&nbsp&nbsp&nbsp<INPUT type=Submit value="Get Password" onclick="return Password();">
Can someone help with this??

Similar Messages

  • How to apply a simple javascript into JSF

    Hi everyone. This is my first time using JSF and i am abit confuse in applying some simple javascript into my JSF. Actually, i just want to add a simple function that is to disable user from input some certain textfield (h:inputText) based on the selection in the combo box (h:selectOneMenu).
    The javascipt that i would like to apply in the JSF coding is shown as below:-
    <HTML>
    <TITLE>Example of onChange Event Handler</TITLE>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function textField()
    if(document.myform.mcDonald.value=="disable")
    document.myform.data.disabled=true;
    if(document.myform.mcDonald.value=="enable")
    document.myform.data.disabled=false;
    </SCRIPT>
    </HEAD>
    <BODY>
    <H3>Example of onChange Event Handler</H3>
    <form name="myform">
    <SELECT NAME="mcDonald" onChange="textField()">
    <OPTION VALUE="enable">Enable
    <OPTION VALUE="disable">Disable
    </SELECT>
    <input type="text" name="data" value="10" size=10 disabled="true" >
    </form>
    </BODY>
    </HTML>

    You need to use the id's of the components in the hierarchy. This is actual working code:
    // Javascript
              function actionedStatus_onchange(formObj, fieldValue) {
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].disabled = (fieldValue != 'all');
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].checked = (fieldValue == 'all');
    // JSF
                   <x:selectOneMenu id="actionedStatus" styleClass="detailBondField" value="#{exceptionsBean.actionedStatus}"
                             onchange="actionedStatus_onchange(this.form, this.value)">
                        <f:selectItems value="#{lookupBean.actionedStatusList}"/>
                   </x:selectOneMenu>
    In this case, the root component form is 'foureye' (a subview), followed by 'tabExceptions' (a form), followed by a checkbox 'unresolvedOnly' that I want to manipulate. Here I am disabling the checkbox and setting the value dependent on the value of the selectOneMenu

  • Simple Javascript to set date

    Hello,
    My simple JavaScript to set the date runs in Acrobat Pro but when I open the same document in reader it set the date but it fails with a dialog pop out of getField error... here is the script followed by the error...
    function populate_date()
    var f = this.getField("ToDay_Date");
    if (!f.value) f.value = util.printd ("m/d/yyyy", new Date());
    populate_date(); // call my function
    Above scripts run when document is opened... In Pro it is stored under Tools/JavaScripts/Document JavaScript...
    When I open it in Reader then I get the following while it set the date on the date filed too!
    Acrobat EScript Built-in Functions Version 11.0
    Acrobat SOAP 11.0
    TypeError: this.getField is not a function
    2:Folder-Level:App:Search Script.js
    What am I not setting right that I get this error...
    Regards,
    Jeff P.

    Hi,
    No it did not do and did not help still same error came out... Let me ask you this... this is a combination of 6 pages of 5-6 forms that this field of "ToDay_Date" is repeated at least 4 times on 4 pages of this combined form and it really populates all the repeated "Today_Date" on all pages in PDF Pro and  Reader but while it does not pop up the error dialog on PDF Pro and runs with no problem but in Reader it pup up the error dialog even after populating all the repeated fields!  Could it be because field has been repeated?  How come it runs and populates all the fields but also gives the error?  I think it is a bug in Reader... don't you think so?
    Regards,
    Jeff P.

  • Getting Exception: @Scratchpad/1:1 exception while running simple javascript code in mozilla scrachpad

    getting Exception: "@Scratchpad/1:1 exception" while running simple javascript code in mozilla scrachpad

    Does this also happen if you run the code in the Web Console (Firefox/Tools > Web Developer)?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Simple javascript not working

    Hello,
    I have got a problem with this simple javascript that works
    on every browser I tested but not on AIR (1.5.0 on Aptana Studio) :
    <html>
    <head>
    <title>Test</title>
    <script type="text/javascript">
    function init()
    display();
    var nb=10;
    function del()
    nb--;
    display();
    function display()
    var i;
    var res = "";
    for (i=0; i<nb; i++)
    res += "<li><a onclick=\"del();\">link"+ i
    +"</a></li>";
    document.getElementById("results").innerHTML = "<ul>"+
    res +"</ul>";
    </script>
    </head>
    <body onload="init()">
    <p onclick="del()">test</p>
    <div id="results"></div>
    </body>
    </html>
    Clicking on any link in the list should reload this list with
    one item less, but it only works once, I do not understand why
    considering this code perfectly works on any browser.
    Clicking on the "test" text in the <p> also works
    perfectly and I have got no error message in the console, so what
    is the problem, please?
    Thanks for your help.

    Unsure what the problem is. I copied almost verbatim and it
    worked fine for me.
    here's my script (slightly different due to my base file is
    xhtml strict)
    quote:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">
    <head>
    <title>Adobe Air 1.5 Test</title>
    <script src="lib/AIRAliases.js"
    type="text/javascript"></script>
    <script src="lib/main.js"
    type="text/javascript"></script>
    <script type="text/javascript">
    function init(){
    display();
    var nb=10;
    function del(){
    nb--;
    display();
    function display(){
    var i;
    var res = "";
    for (i=0; i<nb; i++)
    res += "<li><a onclick=\"del();\">link"+ i
    +"</a></li>";
    document.getElementById("results").innerHTML = "<ul>"+
    res +"</ul>";
    </script>
    </head>
    <body onload="init();">
    <p onclick="del()">test</p>
    <div id="results"></div>
    </body>
    </html>

  • Simple javascript code?

    hello -
    i'm trying to insert some simple javascript into a flash file
    to test how it works.
    within the html file, i have this code:
    <script language="JavaScript">
    function mycallback(value) {
    alert("hello world! - " + value);
    </script>
    what should my action/javascript code look like in my flash
    file?
    here is just a html version of how i want it to work:
    http://www.dkwong.com/example_js.html
    thanks!

    Well, more the advanced features you need, you'll have to compromise somewhere! The code on the link I gave you is about 5KB. When you minify it, it is about 1.4KB.
    Copy the code, use http://jscompress.com/ to minify the code. Include it in your page then.
    -ST

  • OBIEE 11g: Dashboard not invoking simple javascript alert

    Hi Experts,
    I'm trying to invoke one simple ALERT command with javascript in obiee 11g dashboard. The purpose is when it loads, it should print one ALERT message and also when we change something in the prompt and clicking Apply button.
    Here is code written in a text item (Checked html markup option) after prompts;
    <script language="Javascript">
    alert ("Hello");
    </script>
    The Javascript alert message is showing when the dashboard page loads, but its not coming when we click the Apply button after changing the prompts.
    Can anyone give helpful hint, how to check it and why its not showing up when we press Apply button?
    Any hint or some useful links will b highly appreciated.
    Thanks in advance.

    You just used code and I would say the default event is onload of the page, thats the reason you are able to see alert.
    Since you didnt ask or written code onClick event to show alert, its not showing.
    You need to tell to browser when to prompt alert message instead of onload.
    Hope you are more confuse about 'how to do'
    if yes, mark :)
    give some more info about your actual req. that helps any other gurus to help.
    Edited by: Srini VEERAVALLI on Mar 27, 2013 8:42 AM

  • Error in simple javascript search web-part.

    Hi everybody. I need a help. I want to write simple sharepoint farm solution web-part (not App) with javascript for search like describe
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/18/how-to-query-search-with-the-sharepoint-2013-javascript-client-object-model.aspx But I get error. My visual web-part code:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1UserControl.ascx.cs" Inherits="tester.VisualWebPart1.VisualWebPart1UserControl" %>
    <script src="~/_layouts/15/sp.search.js"></script>
    <script src="~/_layouts/15/RDBranding/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
    var results;
    var context;
    _spBodyOnLoadFunctionNames.push("tester");
    function tester() {
    $("#searchButton").click(function () {
    context = SP.ClientContext.get_current();
    var keywordQuery = new Microsoft.SharePoint.Client.Search.Query.KeywordQuery(context);
    keywordQuery.set_queryText($("#searchTextBox").val());
    var searchExecutor = new Microsoft.SharePoint.Client.Search.Query.SearchExecutor(context);
    results = searchExecutor.executeQuery(keywordQuery);
    context.executeQueryAsync(onQuerySuccess, onQueryFail);
    function onQuerySuccess() {
    $("#resultsDiv").append('<table>');
    $.each(results.m_value.ResultTables[0].ResultRows, function () {
    $("#resultsDiv").append('<tr>');
    $("#resultsDiv").append('<td>' + this.Title + '</td>');
    $("#resultsDiv").append('<td>' + this.Author + '</td>');
    $("#resultsDiv").append('<td>' + this.Write + '</td>');
    $("#resultsDiv").append('<td>' + this.Path + '</td>');
    $("#resultsDiv").append('</tr>');
    $("#resultsDiv").append('</table>');
    function onQueryFail(sender, args) {
    alert('Query failed. Error:' + args.get_message());
    </script>
    <div>
    <label for="searchTextBox">Search: </label>
    <input id="searchTextBox" type="text" />
    <input id="searchButton" type="button" value="Search" />
    </div>
    <div id="resultsDiv">
    </div>
    And my error in browser console after button click:
     Any idea? Why?
    Aleksandr Shramko

    I resolve my problem using next code
    $(document).ready(function () {
    Initialise();
    function Initialise() {
    var scriptBase = _spPageContextInfo.webAbsoluteUrl + "/" + _spPageContextInfo.layoutsUrl + "/";
    $.getScript(scriptBase + "sp.runtime.js", function () {
    $.getScript(scriptBase + "sp.js", function () {
    $.getScript(scriptBase + "sp.search.js", tester);
    Aleksandr Shramko

  • Simple Javascript date() function not executing.

    If I open the javascript input window from a button and enter a simple js date function:
    vDate = new Date();
    alert(vDate();
    This code executes flawlessly when the button is clicked.
    However,  if I place the exact same code in the Execute Advacned Actions javascript window "on enter frame" Action, the alert popup code not exdecute/appear, it will fail silently.
    I'm simple trying to get a javascript funtion to execute on... the On Enter Action.
    Any suggestions?
    Thanks

    Hello,
    I just tried the scenario and I can see that JS code is executing properly. I used the same JS as you have given (just corrected the syntax in the second line). So, I create an Advanced action that has this JS, and I assigned that to "On Slide Enter" action of the slide. Other thing that I did is that I chose "current" as the window in the Execute Javascript options.
    Ashish

  • Simple Javascript, difficult placement

    Hi guys,
    I have a very simple requirement for which Ive spent the last 3 days trying to figure out.
    Requirement:
    Show "JAVASCRIPT DISABLED" on form when Javascript is disabled.  Show "" otherwise.
    What I've done:
    I placed a TextField on MasterPage with default text "JAVASCRIPT DISABLED". 
    In event "data::docReady - (JavaScript, client)" wrote a line Page1.StaticText3.rawValue = ""; in order to hide the message.
    Problem:
    For some reason, this script executes even when Javascript is disabled which completely defeats the purpose of the assignment.. Where should I place this Javascript such that it executes ONLY when Javascript is actually enabled....
    Please help! Thanks!

    Guys, thanks for the reply.
    Jono - I've tried to follow the steps from your  document 'Javascript and version test.pdf' but the following problem occurs.  My Javscript code runs even when Javascript is disabled! I know this sounds insane, but please look at the snapshots.
    Note: For the sake of showing you the problem, I've reversed the visible/hidden.
    Initially the TextField is set to Hidden.  Then, in the initialize event - I set it to Visible... 
    As you can see below, even when the bar says "Javascript is currently disabled", it sets the TextField to Visible.
    I've been hacking at this for days now, is there something that I'm missing.  This shouldnt be this difficult, right?
    Thanks again for your help.

  • Simple JavaScript I just can't get to work

    Hi guys I'm new here and to JavaScript really but I have had a go at trying this and it simply wont work for me. Basically I am creating a time-card for my work and because most people dont use military time the total calculations for each day have to take this into account. So I tried to make a script that would +12 if the total number of hours was less than 0; however it doesn't seem to work and still shows the negative number even though I have scripted it not too. I have attached the script bellow and if anyone could assist me it would be greatly appreciated.
    // Start Time
    var v1 = getField("Text1").value;
    // Finish Time
    var v2 = getField("Text2").value;
    // Lunch
    var v3 = getField("Text3").value;
    // Total Hours
    event.value = v2 - v1 - v3;
    if(parseInt(event.value < 0 )) event.value = (parseInt(event.value) + 12).toString();
    many thanks

    Are the start and end time values being treated as numbers or strings by JavaScript?
    What is the formatting of the field?
    // Start Time
    var v1 = getField("Text1").value;
    // Finish Time
    var v2 = getField("Text2").value;
    // Lunch
    var v3 = getField("Text3").value;
    // Total Hours
    event.value = v2 - v1 - v3;
    if(parseInt(event.value < 0 )) event.value = (parseInt(event.value) + 12).toString();
    console.show();
    console.clear();
    console.println("v1: " + v1);
    console.println("type of v1: " + typeof v1);
    console.println("v2: " + v2);
    console.println("type of v2: " + typeof v2);
    console.println("v3: " + v3);
    console.println("type of v3: " + typeof v3);
    Using civilian 24 hour time format for the fields, I get the following result:
    v1: 9:00
    type of v1: string
    v2: 17:00
    type of v2: string
    v3: 0:30
    type of v3: string
    The calculation results in a NaN value.

  • Simple javascript APEX question

    Hello,
    I am new to oracle APEX and am trying to complete an application but have one small issue. I am using a barcode gun to check in servers and other hardware, and once it is scanned it sends an "enter" to add the next row in my Master-Detail form. The code i am using for this is : onkeydown="javascript:if(event.keyCode==13){event.keyCode=9;return event.keyCode}" This works fine, it takes my enter from the barcode and tabs it to the next line. However at a different part of the form I need to make it convert my enter to a tab, and then back to an enter. Essentially I need it so that I scan the barcode, it then submits an enter, which is converted to a tab, and then I want it to then use an enter key. I cannot get this to work. My java skills are lacking, and this is what I have come up with:
    onkeydown="javascript:if(event.keyCode==13){event.keyCode=9;return event.keyCode;event.keyCode=13;return event.keyCode}" This is just not working, any ideas on what I can do?
    Thanks
    Aaron

    let me clarify, I have a master detail app. basically, the master holds all the racks for a datacenter, and the details page holds all the hardware within each rack. this means i can click on rack A1, and then see all hardware within that rack. when I am creating a master record, i need it so that I can just scan the rack barcode and move on to the next one. The problem is, after typing in a rack name (not even with scanner) and pressing enter, it auto cancels my rack entry. I have tried changing text field to submit on enter, and even tried java to the dosumbit('Apply_changes_add') with no luck. The easiest way for me to implement this is to have it so that on this form element (rack_name), when you press enter, it converts to a tab (which moves the cursor to the (create rack button) and then presses enter (to submit this page). I agree that this may not be the best way of fixing this issue, but I have no other way of going about it. any suggestions?

  • URGENT :simple javascript

    Hi In my JSP form takes only number or Float values none other than these.
    I want to check up if user enters .(DOT) in the begening if enters then i have to replace that value with 0.(ZERO DOT)
    USING JAVASCRIPT CAN I

    Hi,
    Try this
    if ( textbox.value.charAt(0) == ".'" ){
    textbox.value = "0" + textbox.value;
    Rahim Vindhani.

  • Need simple javascript for pro x

    I am trying to find someone to script for acrobat pro x
    I am struggling to find someone that can script this...
    I start with an open multi page pdf in acrobat pro x
    Under the Tools panel, select the Edit Object tool.
    Ctrl + A will select everything in the current page.
    Right click and select flip horizontal.
    Lastly, page down.
    Then repeat all these steps on each page.
    I really need this automated somehow...

    There is a commercial Acrobat plug-in that can do this: http://www.quite.com/box/features.htm

  • Help with simple Javascript calculation please

    Hello, I've created a form for my company that contains measurements in meters for shipping.  I need to have the total of the measurement appear in the cube/M3 field.  For example, 6.17*3.02*3.35 returns NaN - it should return 62.42.  My fields are called Measure1Row and CubeM31Row.  This field will also be calculated as a total which I had no problem setting up. Under simplified field notation I entered = Measure1Row and it didn't work.  I also tried Measure1Row * 1.  Can someone please help me out?  Thanks so much!

    Hi George,
    I want the product of this measurement 6.17*3.02*3.35 (in meters) to appear in theCubeM31Row.  There are only 2 fields that are affected by this calculation - Measurement and Cube/M3.  The form fields are Qty, Commodity, Measurements, lbs, kgs and Cube/M31Row.  The measurement appears in one field - the other fields contain calculations that match and produce the correct answer.  Does that help?  I'm stumped.

Maybe you are looking for

  • Flatfile idoc sender scenario

    Hi all, we try to implement a flat file-XI-IDoc scenario. We receive flat files with idoc structure In ID I used sender file adapter and a receiver idoc adapter I have to use the option "File Content Conversion" in the file adapter and do I have to r

  • Can print color from Adobe Reader but not from Word

    I can print a color document from Adobe Reader. But if I print another color document from Word, it comes out in black&white. Both are on an HP Color LaserJet CP2025dn printer. The settings selected in the system Print dialog are the same. What's the

  • Drag and drop in JTree's

    Hello, How/can do you do drag and drop of elements within or between JTree's. I am working on a bookmark editor program and need a tree control for sorting bookmarks in a heirachy. I would like some sort of insert line to appear between elements as a

  • How refresh JProgressBar display ?

    I use a JProgressBar in my program but the display of it is never refresh even if I use updateUI method. Do you know a way to have a real refresh of my display ?

  • How to update from 4.2.1 to iso 5 or higher

    how to update from iso 4.2.1 to iso 5 or higher. Not able to download certain apps that are iso 5 and higher. Need help please