Java Script Diag Box

In the last days I have bee received this request in Safari.

Even when I'm in a website just read text (do nothing)

What is the cause of popo upward?

all ideas,

Thank you

JRC

1. click on the button "stay on the Page.

Safari > Preferences > Security > Web content:

Uncheck 'enable JavaScript.

2. click  in the menu bar and select "force quit."

In the window that opens, select "Safari" and click "leave power.

3 restart Safari by holding down the SHIFT key.

4 safari > Preferences > Security > Web content:

Again check the box 'enable JavaScript.

Tags: Mac OS & System Software

Similar Questions

  • EXC in ev handl: TypeError: this.oRoot.enable is not a function that is popping up when I befor I open my browser in a box pop up under the heading JAVA SCRIPT EXE. That is - what, how can I get rid of him?

    TypeError: this.oRoot.enable is not a function

    This is popping up when I befor I open my browser,in a pop up box under the heading JAVA SCRIPT EXE. What is it, how do I get rid of it?
    

    For me, this happened from disabling, but do not uninstall McAfee site Advisor. Recommend site completely uninstalled and the problem disappeared completely. I had turned off before site Advisor, but it seems after a update to McAfee, he was back and then turn it off again caused this problem.

    Go to "uninstall a program" or "add/remove programs" in control panel. Find McAfee in your list (McAfee total protection for me). Click it and then click "Uninstall/Change" (right there in XP, up above in Vista or 7). I don't remember exactly what you see after that, but at one screen I was given the choice to uninstall the McAfee total protection and/or the Site Adviser. You can just check the Site Adviser and just uninstall the Site Adviser while retaining the rest of the McAfee protection.
    

    Good luck!

  • Java script for counting the text boxes

    I have 10 text boxes. Y at - it somehow I can create a java script for an eleventh text box so whenever you type a number into one of the 10 text boxes it adds the value 1. By example, if you typed a number to 4 number 4 text boxes come in box 11. I googled everywhere and I just can't understand the sense. Any help would be appreciated.

    Of course, it is possible. Let's say the text fields are called "Text1" to "Text10" and the last of them is called "Text11"

    Use this code as the custom Text11 computer code:

    var total = 0;
    for (var i=1; i<=10; i++) {
        if (this.getField("Text"+i).valueAsString!="") total++;
    }
    event.value = total;
    
  • Enable Java script is checked, but the site says that it is not authorized

    After getting the following message when you try to log in my Bank I checked FireFox\Tools\Options\Content and found that the box to enable java script has BEEN verified. FireFox is acting as if she is not allowed. How to solve this?

    Well, it is finally resolved. Thank you all for the help. A technician from one of my brokerage sites, which had a link blackened think there might be an announcement on. He clearly had me on history and cookies. then led me to a link to reset FireFox. After resetting everything works AND I have not lost all bookmarks or log in information. It's a relief to have FireFox again.

    I especially thank Cor - el and the great search engine in the FireFox support site. I'm pretty sure I'm going to need you all again some time; but for now I can just go on my work.

  • Problem with Java Script in my mail service

    I'm unable to access my email GMX account. Whenever I try, a rose windows opens at the top indicating that Java Script is required. However, when I check with the tolls, the enable JavaScript box is checked. I've deleted and reinstalled Firefox 10.0.1 two times with the same results. I can to my account via Internet Explorer and Safari without difficulty.

    Any ideas?

    Due to various difficulties, I reinstalled Windows 7. That solved the problem

  • Why did the Java script works on my work for Internet explore, but not for Firefox RSS feeds?

    I finished building the Web site for my girlfriend, and the rest is the RSS feed. It works just fine in IE 8, but Fire Fox 9 when the widget is clicked a bookmark box appears and asks if I want to save it as a bookmark. I'm not a programmer of the Java script so I hope help here! Here's the script:

  • "< a href ="http://www.susangabrielle.com/1/feed"title ="RSS"alt ="rss">< /a >"
  • The view is http://www.susangabrielle.com

    Probably you fixed, the RSS seems to work for me

  • Java script active is checked in the Options but said webex cannot start because the Jave being disabled

    You need to enable Java script. When I look in the Options menu of the box is checked which corresponds to activate Java.
    However I can't start Webex as a dialog box opens that says that Java script is not enabled in the browser.

    How can I fix it? Thank you / / Joe

    This has happened

    Don't know how many times

    is after that I installed Firefox

    http://KB.mozillazine.org/JavaScript_is_not_Java

    http://KB.mozillazine.org/Java
    http://KB.mozillazine.org/JavaScript

    Tools > Addons > > plugins = this is where you enable Java

  • How can I activate the java script

    original title: Java script

    How can I activate the java script

    Internet Explorer 8:

    1. Open Internet Explorer, click on the "Tool" button in the menu bar, click 'Internet Options' and then select the security"" tab.
    2. Select the 'Internet' zone, select "Custom level" and go to the "Security settings - Internet Zone" box.
    3. Click the checkbox enable "Active Scripting" under the Scripting section, and then click the OK button to apply the settings. Restart your browser when you have finished to apply the settings and enable JavaScript.

    Firefox:

    http://support.Mozilla.com/en-us/KB/JavaScript

    Chrome (for the old version, but could be similar):

    http://www.chromefans.org/chrome-tutorial/how-to-disable-JavaScript-nojavascript-NoScript-in-Google-chrome.htm

    Questions about installing Windows 7?
    FAQ - Frequently Asked Questions from Installation Windows 7 & responses

  • Using java script with QML, save a text in a variable of java script and showing in a label

    I'm trying to find a way to take a text entered by the user into a text field and display it in a label using java script. The trickiest part is I want to be seen in the label after restarting the application.
    Any idea?
    Should I use a JS file with functions. If so, what are best practices?

    Thanks in advance!

    This example uses a little bit of C++, I'm not sure if this can be done with purely JS

    in your text box or label apply onTextChanged you probably want to have a Setup button to activate & deactivate the area of text, or if they delete it, the text of the label would be erased

    . QML

    TextArea {
        id: myTextArea
        onTextChanged: {
            myTextArea.text = myLabel.text;
            //you could also apply ^ to a button's onClicked function etc
            App.saveValueFor("mySavedText" myTextArea.text);
        }
    }
    Label {
        id: myLabel
        text: App.getValueFor("mySavedText", "");
    }
    

    App.saveValueFor (); QSettings uses will have to be reset in your ApplicationUI.cpp & .h

    .cpp

    App is obtained by setting a context property

    qml->setContextProperty("App", this);
    
    QString App::getValueFor(const QString &objectName, const QString &defaultValue)
    {
        QSettings settings;
    
        // If no value has been saved, return the default value.
        if (settings.value(objectName).isNull()) {
            return defaultValue;
        }
    
        // Otherwise, return the value stored in the settings object.
        return settings.value(objectName).toString();
    }
    
    void App::saveValueFor(const QString &objectName, const QString &inputValue)
    {
        // A new value is saved to the application settings object.
        QSettings settings;
        settings.setValue(objectName, QVariant(inputValue));
    
    }
    

    all

    public:
    
        Q_INVOKABLE
        QString getValueFor(const QString &objectName, const QString &defaultValue);
    
        Q_INVOKABLE
        void saveValueFor(const QString &objectName, const QString &inputValue);
    

    You'll also need to slect the permission of files shared in the descriptor for QSettings bar to work

  • Can you help me to insert a JAVA script into an Adobe PDF form I created.

    I have never programmed in Java and need a Java script to insert in a calculation field in an Adobe PDF form that I created using Adobe Acrobat Pro DC.  This form will be the one that can be filled on the PC or printed and filled out manually.  The calculated field will display a zero unwanted when printing and I want it to be empty.  Another field will be a calculated percentage and displays an error when there is no divider; a similar problem, I want to be a Virgin and the person filing the form manually to calculate the field and write.  I don't have time to learn

    The Excel formula would be: If (Cell_1A = "", "", Cell_1A + Cell_1B)

    What would be the JAVA script in a dialog box "Simplified field Notation" or "custom calculation Script?

    Both of these things require a custom calculation. For the script of the division, you can use something like this:

    var a = Number(this.getField("Field A").value);
    var b = Number(this.getField("Field B").value);
    if (b==0) event.value = "";
    else event.value = a/b;
    

    For the conditional script, you can use this:

    var a = this.getField("Cell_1A").valueAsString;
    var b = this.getField("Cell_1B").valueAsString;
    if (a=="") event.value = "";
    else event.value = Number(a)+Number(b);
    
  • What is the java script code that makes an annotation appears as flattened (permanent) on a page?

    I have custom dialog box based on the java script code that prompts the user to enter data for a room tag.  This label is then annotated on the pdf document. At the present time, the captured annotation can be deleted.  I want to be show as permanent on the pdf page. 

    Thank you.

    You must flatten the page that this annotation is one to convert static content into PDF. To do this, use the Doc.flattenPages () method:

    The SDK Acrobat DC - Doc.flattenPages () SDK documentation

  • How to change folder name by default when you use save for Web in java script?

    Hello everyone, hope you can help me.


    Photoshop has a folder name by default of images When you export using slices Save for Web . I need to change this folder name.

    How to change folder name by default when you use save for Web in java script?

    Thanks in advance!


    1325ACD7-9C89-4D20-A6BF-E9EE8B7A1D27.png

    QQ20150923-1@2x.png


    JJMack Chuck Uebele Nicolas Ribot SuperMerlin

    You can try with scriptlistener to record the code. Change to the last line of the NO to ALL dialog boxes, so that the dialog - if you wish. There are two places in the code to save the files: one where is actually saved the file, and the other where the default value is file. I have seen it changed something with it. So, you can simply use the first listing of a path in the code below.

    #target photoshop
    
    var idExpr = charIDToTypeID( "Expr" );
        var desc19 = new ActionDescriptor();
        var idUsng = charIDToTypeID( "Usng" );
            var desc20 = new ActionDescriptor();
            var idOp = charIDToTypeID( "Op  " );
            var idSWOp = charIDToTypeID( "SWOp" );
            var idOpSa = charIDToTypeID( "OpSa" );
            desc20.putEnumerated( idOp, idSWOp, idOpSa );
            var idDIDr = charIDToTypeID( "DIDr" );
            desc20.putBoolean( idDIDr, true );
            var idIn = charIDToTypeID( "In  " );
            desc20.putPath( idIn, new File( "C:\\Users\\csuebele\\Pictures\\LR shortcuts" ) );//Here's where it actually saves
            var idFmt = charIDToTypeID( "Fmt " );
            var idIRFm = charIDToTypeID( "IRFm" );
            var idPNtwofour = charIDToTypeID( "PN24" );
            desc20.putEnumerated( idFmt, idIRFm, idPNtwofour );
            var idIntr = charIDToTypeID( "Intr" );
            desc20.putBoolean( idIntr, false );
            var idTrns = charIDToTypeID( "Trns" );
            desc20.putBoolean( idTrns, true );
            var idMtt = charIDToTypeID( "Mtt " );
            desc20.putBoolean( idMtt, true );
            var idEICC = charIDToTypeID( "EICC" );
            desc20.putBoolean( idEICC, false );
            var idMttR = charIDToTypeID( "MttR" );
            desc20.putInteger( idMttR, 255 );
            var idMttG = charIDToTypeID( "MttG" );
            desc20.putInteger( idMttG, 255 );
            var idMttB = charIDToTypeID( "MttB" );
            desc20.putInteger( idMttB, 255 );
            var idSHTM = charIDToTypeID( "SHTM" );
            desc20.putBoolean( idSHTM, false );
            var idSImg = charIDToTypeID( "SImg" );
            desc20.putBoolean( idSImg, true );
            var idSWsl = charIDToTypeID( "SWsl" );
            var idSTsl = charIDToTypeID( "STsl" );
            var idSLAl = charIDToTypeID( "SLAl" );
            desc20.putEnumerated( idSWsl, idSTsl, idSLAl );
            var idSWch = charIDToTypeID( "SWch" );
            var idSTch = charIDToTypeID( "STch" );
            var idCHsR = charIDToTypeID( "CHsR" );
            desc20.putEnumerated( idSWch, idSTch, idCHsR );
            var idSWmd = charIDToTypeID( "SWmd" );
            var idSTmd = charIDToTypeID( "STmd" );
            var idMDCC = charIDToTypeID( "MDCC" );
            desc20.putEnumerated( idSWmd, idSTmd, idMDCC );
            var idohXH = charIDToTypeID( "ohXH" );
            desc20.putBoolean( idohXH, false );
            var idohIC = charIDToTypeID( "ohIC" );
            desc20.putBoolean( idohIC, true );
            var idohAA = charIDToTypeID( "ohAA" );
            desc20.putBoolean( idohAA, true );
            var idohQA = charIDToTypeID( "ohQA" );
            desc20.putBoolean( idohQA, true );
            var idohCA = charIDToTypeID( "ohCA" );
            desc20.putBoolean( idohCA, false );
            var idohIZ = charIDToTypeID( "ohIZ" );
            desc20.putBoolean( idohIZ, true );
            var idohTC = charIDToTypeID( "ohTC" );
            var idSToc = charIDToTypeID( "SToc" );
            var idOCzerothree = charIDToTypeID( "OC03" );
            desc20.putEnumerated( idohTC, idSToc, idOCzerothree );
            var idohAC = charIDToTypeID( "ohAC" );
            var idSToc = charIDToTypeID( "SToc" );
            var idOCzerothree = charIDToTypeID( "OC03" );
            desc20.putEnumerated( idohAC, idSToc, idOCzerothree );
            var idohIn = charIDToTypeID( "ohIn" );
            desc20.putInteger( idohIn, -1 );
            var idohLE = charIDToTypeID( "ohLE" );
            var idSTle = charIDToTypeID( "STle" );
            var idLEzerothree = charIDToTypeID( "LE03" );
            desc20.putEnumerated( idohLE, idSTle, idLEzerothree );
            var idohEn = charIDToTypeID( "ohEn" );
            var idSTen = charIDToTypeID( "STen" );
            var idENzerozero = charIDToTypeID( "EN00" );
            desc20.putEnumerated( idohEn, idSTen, idENzerozero );
            var idolCS = charIDToTypeID( "olCS" );
            desc20.putBoolean( idolCS, false );
            var idolEC = charIDToTypeID( "olEC" );
            var idSTst = charIDToTypeID( "STst" );
            var idSTzerozero = charIDToTypeID( "ST00" );
            desc20.putEnumerated( idolEC, idSTst, idSTzerozero );
            var idolWH = charIDToTypeID( "olWH" );
            var idSTwh = charIDToTypeID( "STwh" );
            var idWHzeroone = charIDToTypeID( "WH01" );
            desc20.putEnumerated( idolWH, idSTwh, idWHzeroone );
            var idolSV = charIDToTypeID( "olSV" );
            var idSTsp = charIDToTypeID( "STsp" );
            var idSPzerofour = charIDToTypeID( "SP04" );
            desc20.putEnumerated( idolSV, idSTsp, idSPzerofour );
            var idolSH = charIDToTypeID( "olSH" );
            var idSTsp = charIDToTypeID( "STsp" );
            var idSPzerofour = charIDToTypeID( "SP04" );
            desc20.putEnumerated( idolSH, idSTsp, idSPzerofour );
            var idolNC = charIDToTypeID( "olNC" );
                var list4 = new ActionList();
                    var desc21 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCzerozero = charIDToTypeID( "NC00" );
                    desc21.putEnumerated( idncTp, idSTnc, idNCzerozero );
                var idSCnc = charIDToTypeID( "SCnc" );
                list4.putObject( idSCnc, desc21 );
                    var desc22 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNConenine = charIDToTypeID( "NC19" );
                    desc22.putEnumerated( idncTp, idSTnc, idNConenine );
                var idSCnc = charIDToTypeID( "SCnc" );
                list4.putObject( idSCnc, desc22 );
                    var desc23 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwoeight = charIDToTypeID( "NC28" );
                    desc23.putEnumerated( idncTp, idSTnc, idNCtwoeight );
                var idSCnc = charIDToTypeID( "SCnc" );
                list4.putObject( idSCnc, desc23 );
                    var desc24 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwofour = charIDToTypeID( "NC24" );
                    desc24.putEnumerated( idncTp, idSTnc, idNCtwofour );
                var idSCnc = charIDToTypeID( "SCnc" );
                list4.putObject( idSCnc, desc24 );
                    var desc25 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwofour = charIDToTypeID( "NC24" );
                    desc25.putEnumerated( idncTp, idSTnc, idNCtwofour );
                var idSCnc = charIDToTypeID( "SCnc" );
                list4.putObject( idSCnc, desc25 );
                    var desc26 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwofour = charIDToTypeID( "NC24" );
                    desc26.putEnumerated( idncTp, idSTnc, idNCtwofour );
                var idSCnc = charIDToTypeID( "SCnc" );
                list4.putObject( idSCnc, desc26 );
            desc20.putList( idolNC, list4 );
            var idobIA = charIDToTypeID( "obIA" );
            desc20.putBoolean( idobIA, false );
            var idobIP = charIDToTypeID( "obIP" );
            desc20.putString( idobIP, """""" );
            var idobCS = charIDToTypeID( "obCS" );
            var idSTcs = charIDToTypeID( "STcs" );
            var idCSzeroone = charIDToTypeID( "CS01" );
            desc20.putEnumerated( idobCS, idSTcs, idCSzeroone );
            var idovNC = charIDToTypeID( "ovNC" );
                var list5 = new ActionList();
                    var desc27 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCzeroone = charIDToTypeID( "NC01" );
                    desc27.putEnumerated( idncTp, idSTnc, idNCzeroone );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc27 );
                    var desc28 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwozero = charIDToTypeID( "NC20" );
                    desc28.putEnumerated( idncTp, idSTnc, idNCtwozero );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc28 );
                    var desc29 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCzerotwo = charIDToTypeID( "NC02" );
                    desc29.putEnumerated( idncTp, idSTnc, idNCzerotwo );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc29 );
                    var desc30 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNConenine = charIDToTypeID( "NC19" );
                    desc30.putEnumerated( idncTp, idSTnc, idNConenine );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc30 );
                    var desc31 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCzerosix = charIDToTypeID( "NC06" );
                    desc31.putEnumerated( idncTp, idSTnc, idNCzerosix );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc31 );
                    var desc32 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwofour = charIDToTypeID( "NC24" );
                    desc32.putEnumerated( idncTp, idSTnc, idNCtwofour );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc32 );
                    var desc33 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwofour = charIDToTypeID( "NC24" );
                    desc33.putEnumerated( idncTp, idSTnc, idNCtwofour );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc33 );
                    var desc34 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwofour = charIDToTypeID( "NC24" );
                    desc34.putEnumerated( idncTp, idSTnc, idNCtwofour );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc34 );
                    var desc35 = new ActionDescriptor();
                    var idncTp = charIDToTypeID( "ncTp" );
                    var idSTnc = charIDToTypeID( "STnc" );
                    var idNCtwotwo = charIDToTypeID( "NC22" );
                    desc35.putEnumerated( idncTp, idSTnc, idNCtwotwo );
                var idSCnc = charIDToTypeID( "SCnc" );
                list5.putObject( idSCnc, desc35 );
            desc20.putList( idovNC, list5 );
            var idovCM = charIDToTypeID( "ovCM" );
            desc20.putBoolean( idovCM, false );
            var idovCW = charIDToTypeID( "ovCW" );
            desc20.putBoolean( idovCW, true );
            var idovCU = charIDToTypeID( "ovCU" );
            desc20.putBoolean( idovCU, true );
            var idovSF = charIDToTypeID( "ovSF" );
            desc20.putBoolean( idovSF, true );
            var idovCB = charIDToTypeID( "ovCB" );
            desc20.putBoolean( idovCB, true );
            var idovSN = charIDToTypeID( "ovSN" );
            desc20.putString( idovSN, """c:\photos""" );//Here's where the default folder is suppose to go.
        var idSaveForWeb = stringIDToTypeID( "SaveForWeb" );
        desc19.putObject( idUsng, idSaveForWeb, desc20 );
    executeAction( idExpr, desc19, DialogModes.ALL );
    
  • Adobe's Java Script

    Hey all.

    I created a form that includes a series of checkboxes at the bottom next to tasks remaining to be done. I need a separate text box to display a percentage of success based on how several checkboxes are "checked".

    I guess it must be done with Java Script, but I'm not very skilled in that Department. One of the suggestions or know how to proceed.

    Any help would be greatly appreciated.

    Thanks in advance.

    I would look at setting each 1 checkbox checked. The text field for the result of the average for a format of 'Percent' and for the calculation of the use tab the "field is the _ or the following fields:" to calculate the "average" and select the checkbox fields. "

  • Java Script issues

    Hi all

    IM developing a Memorial Web site and I would like to use the jQuery plugin noble County http://tpgblog.com/noblecount/on this page of the site http://www.milesmemorials.com/Product-GH54.html. As you can see there is a text box for the "wording" where customers can enter in what they would like to have engraved on the headstone. The first hundred letters are included in the price (total operation are calculated and displayed at the bottom of the page "grand_total"), all the letters after that have the price indicated by letter according to the type of engraving they chose (see the drop letters engraved for price per letter). The plug in I want to use is to display the number of letters in the textarea as they are typed. When 100 characters are typed there will be a color change to warn customers, then I need some sort of function to multiply the remaining characters (if there is) by the amount required by the letter (dictated by the engravings options) to be added to the box grand_total.

    BUT! Im having problems with this development, as I have very limited knowledge of Java script. Is there someone who can help me with this? I understand its quite complex and am happy to pay someone produce the Java Script for me.


    $("textarea").val($("textarea").val() + " " + verse);
    

    should be

    $("#textarea").val($("#textarea").val() + " " + verse);
    

    Also delete this old writing of yours as this is obsolete:

    $(window).load(function(){
        function putIt(e) {
        $("#textarea").val(e.target.value);
       }
       $("#verse_inscriptions").on("change", putIt);
    });
    

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Problem to find the Position of the cursor by using Java Script for an input TextField

    Hello

    I have a problem to find the position of the cursor in a field inputText component.

    The following code of java script to achieve. The same functionality works fine if I run in a simple html page. But when it is used the same javascript inside the jsff does not the position of the cursor.
    var adfComponent = AdfPage.PAGE.findComponentByAbsoluteId("r1:1:it3");
    var adfComponentClientId = adfComponent.getClientId();
    var div = document.getElementById(adfComponentClientId + '::content');
    div.focus();
    var docSelectionRange = document.selection.createRange();
    
    docSelectionRange.moveStart ('character', -div.value.length);
    
    var iCaretPos = docSelectionRange.text.length;
    
    alert("iCaretPos --> "+iCaretPos);  ---> This statement always returning '0'. Instead, i want the cursor position inside the text box.
    Please let me know what I'm missing.

    For your reference, sending the sample page html that works fine with the same kind of code.
    <html>
     
     <body style="font-family: tahoma; font-size: 8pt;">
     
      <script language="JavaScript">
     
       /*
       **  Returns the caret (cursor) position of the specified text field.
       **  Return value range is 0-oField.length.
       */
       function doGetCaretPosition (oField) {
     
         var iCaretPos = 0;
              alert(oField);
         if (document.selection) { 
     
           // Set focus on the element
           oField.focus ();
     
           // To get cursor position, get empty selection range
           var oSel = document.selection.createRange ();
     
           // Move selection start to 0 position
           oSel.moveStart ('character', -oField.value.length);
     
           // The caret position is selection length
           iCaretPos = oSel.text.length;
         }
     
         // Firefox support
         else if (oField.selectionStart || oField.selectionStart == '0')
           iCaretPos = oField.selectionStart;
     
         // Return results
         return (iCaretPos);
       } 
      
     
     
      </script>
     
      <form name="blah">
     
       Text Field: <input type="text" name="nameEdit" value="">
       <input type="button" value="Get Caret" onClick="document.getElementById('where').value=doGetCaretPosition (document.forms[0].elements[0]);">
    <input id="where">
      
     
      </form>
     
     </body>
     
    </html>
    Thank you and best regards,
    Kiran kristelle

    Published by: Kiran kristelle on February 6, 2012 12:00

    ... had the chance to look at the source code of the sample. ADF Faces renders text as HTMLTextArea fields when the value of the rows property. The JavaScript code used in the example of client works differently for FF and IE if the input is a text box. This could be a problem in IE or just used JavaScript code. The rows back to a single line (remove) property makes the text as HTML input feldworking with the JavaScript for IE and FF.

    Frank

Maybe you are looking for