Traversing HTML using JavaScript

Can some one tell me if this is possible and point me to a good link to read up about this.
I have a jsp page called MasterDeDisplay.jsp. It takes an object in and dynamically builds the page I want to display based on what was sent back from the database or an xml file.
The page that is build contains for example the following html.
<tr>
     <!-- Display single data element -->
     <td id="1"><input type="text" size="3" MAXLENGTH="3"
          class="hotspot_fund_id dynarch-menu-ctxbutton-left" name="iefT381c500"
          value="" id="500">
     </td>
     <!-- Display single data element -->
     <td id="2"><input type="text" size="17" MAXLENGTH="17"
          name="iffT381c540" value="0.000000"
          onblur="percentAmountFunction(this);" id="540"></td>
     <!-- Display single data element -->
     <td id="3"><input type="text" size="17" MAXLENGTH="17"
          name="iffT381c541" value=""
          onblur="percentAmountFunction(this);" id="541"></td>
     <!-- Display single data element -->
     <td id="4"><input type="text" size="3" MAXLENGTH="3"
          class="hotspot_fund_id dynarch-menu-ctxbutton-left" name="iefT381c505"
          value="" id="505">
     </td>
     <!-- Display single data element -->
     <td id="5"><input type="text" size="17" MAXLENGTH="17"
          name="iffT381c545" value="0.000000"
          onblur="percentAmountFunction(this);" id="545"></td>
     <!-- Display single data element -->
     <td id="6"><input type="text" size="17" MAXLENGTH="17"
          name="iffT381c546" value=""
          onblur="percentAmountFunction(this);" id="546"></td>
</tr>You will notice that each td has an id.... this page has about 20 rows and each row looks identical except for the names.
I want the onblur function for <td id="2"> to disable the input field (if certain conditions are met) in <td id="3"> the same for 3to2 5to6 and 6to5... but I do not know how to go from the input field to the td that it resides in. I can modify the id so that it is a concatination of the row count and the td count for example as 1~1 through 1~6 or something... that way if I can get to the td I can parse it's id and decide the new id to get using getElementbyId function.
And no I can not mess with the id of the input field... that was put there by another developer and is being used by other aspects of the application...

looks like I was able to do this without traversing.. thanks if anyone takes a look at this.
of course I haven't made it work yet... just proved that the data I need is available :)

Similar Messages

  • How can I use javascript in a Text Area with HTML editor??

    My question is... how can I use javascript in Text Area with HTML editor??
    I can use javascript functions that change the content of Text Areas but i can´t if i try in text area with html editor....
    I need to limit number of characters in a text area with html editor and i can´t.
    could anybody help me please?

    I have been experiencing similar problems with the HTML Editor and have managed to find an answer that should start to answer some of my questions. The Apex HTML Editor Standard is actually an HTML editor called FCKeditor. The FCKeditor has a Javascript API that can be found at http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API. Unfortuately this doesn't seem to give the whole answer and I found more at http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:49607.
    I needed to get the text entered within my html editor standard (e.g. P1_MYTEXT) and use it within my javascript function. I did this by using the following script
    <script language="JavaScript" type="text/javascript">
    function showtext(){
    var oEditor = FCKeditorAPI.GetInstance('P1_MYTEXT');
    var editortext = escape(oEditor.GetXHTML(oEditor.FormatOutput));
    alert(editortext);
    </script>
    Hope this helps.
    Matthew

  • HTML DB Items Using JavaScript

    I have a page that is based on a SQL Query (PL/SQL Function Body Returning SQL Query). If I call another page from one of the items using a URL such as
    f?p=&APP_ID.:6:#APP_SESSION#::::P6_ID:#ID#
    it calls the new page fine.
    If I try and call it using the example in :
    http://www.oracle.com/technology/products/database/htmldb/howtos/how_to_create_custom_popups.html
    So change it to have an HTML expression of :
    &lt;a href="javascript:callMyPopup('ID');"&gt;Notes&lt;/a&gt;
    the ID never seems to be seen.
    If i do an function callMyPopup (formItem1) {
    var formVal1 = document.getElementById(formItem1).value;
    alert('value is ' || formVal1);
    the values is also not displayed.
    This is the first time I have tried to use Javascript, is my problem because the ID is part of the Query rather than a static field ?
    Thanks
    Paul

    Hello Paul,
    Your JavaScript function will not work properly because you try to pass a form item value to that function. But you are calling the function from a query.
    Try the following:
    First, change the URL from:
    f?p=&APP_ID.:6:#APP_SESSION#::::P6_ID:#ID#
    to:
    javascript:callMyPopup('#ID#');
    Second, change the link text from:
    <img src="#IMAGE_PREFIX#...>
    to:
    Note
    Third, change your JavaScript function:
    function callMyPopup (qvalue) {
    alert('value is ' + qvalue);
    Regards,
    Tom

  • Hide an HTML button using javascript

    Hi,
    I need to hide an html buttton using javascript. I have an radio button with values "YES" and "NO". If is select NO then i need hide the button without refreshing the page. Can anyone suggest me how to hide an button using javascript.
    Thanks
    Prashanth

    Prashanth,
    The exact solution will vary based on a few factors. The basic idea is to place an event handler on the radio button item that calls a function to hide/show the button. You might also want to call that function when the page loads too.
    If you put an example page on apex.oracle.com and provide the workspace/username/password I'll take a look. You can create a new account for this purpose.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Use of HTML and Javascript within EP

    I have a newbie question:
    I have several HTMl documents with javascript embedded like e.g. various calculators we use on the current website.
    If I want to migrate these html sources to EP content, what can I best do than?
    I assume that all existing html and javascript renders as normal without too many development involved?
    Is there a good example how-To source which I can use to demonstrate this?
    many thanks for your help

    Hi,
    Well there are two options:
    <b>1) If you are interested to make the portal component and then use in Portal.
    2) If you want to use your earlier HTML document as it is inside the portal.</b>
    In case 1 you need to make the Portal objects and then make a portal project. You can use javascript in that as well.
    In case 2 you can directly make the URL iView of the HTML document and then view it from the portal. Well this is not a good way of using your javascript. Personally I suggest you to go for Portal Project.
    I hope this help you!!
    Regards
    Pravesh
    PS: Please consider reewarding points.

  • Trying to open a page in IE-tab using javascript, script type="text/javascript" window.location.href="chrome://coralietab/content/container.html?url=0,myurl" /script Error:Component returned failure code:0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]

    I am trying to open a page in IE-tab using javascript like this, <script type="text/javascript"> window.location.href = "chrome://coralietab/content/container.html?url=0,myurl" ;</script>.Error occured : [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::myurl :: load :: line 234" data: no] I have IE-Tab plug-in installed..when I open the same link manually in mozilla,it works fine and page gets opened in Ie-tab.

    The only way this might be possible is by using the HostContainer object
    to access the HTML page and do it from there.

  • Can I use JavaScript HTML Portlet and PDK Portlets

    Can I use JavaScript HTML Portlet and PDK Portlets?
    My Script works fine with the an HTML portlet but it always gives a an Error Message in the status bar is that normal...
    Other then that I have JavaScript in my PDK portlet page it does not work.. it is the the same javascript I use for in my HTML portlet which works in HTML portlets..

    You'll have to place your JavaScript in the header section of your Portal page. To do so, use HTML/UI templates. For more information, refer to the How to Design and Build Compelling Portal Interfaces whitepaper.
    Good luck,
    Peter

  • Can I package an app using just html and javascript and not flash ?

    Hi :
    Sorry for the question, but I'm a little confused. 
    I know I can use javascript with adobe air, I made some test and works great, but I'm not sure if my app will work in an iphone after I build the package.
    Thanks in advanced.

    No, that's not supported in this version of PFI.  From the Developer Guide: "You cannot write HTML- and JavaScript-based AIR applications for the mobile device profile."

  • Overwriting the value of an html:hidden tag using javascript

    Hi!
    Can somebody help me with my problem?
    I need to overwrite the value of my html:hidden tag using javascript, but I dont know how?
    Any help?
    Thanks

    what are you talking about :x
    thats a webapplication question, wrong forum..
    But you are using STRUTS I would say...
    <html:hidden property="hiddenfield"/>This is the proper way of doing it.. but overrighting it
    I don't think you understand why we use that?
    It is only for forms.... we use that for hidden input ... It is common sence not to overrde that value.

  • What HTML and JavaScript engine is used within Adobe AIR on the desktop?

    HTML and JavaScript within Adobe AIR are handled by the WebKit HTML/JavaScript engine.

    I've made a little headway with this. Within your initHandler just make a call to login:
    FacebookMobile.login(loginCallback, this.stage, [], webview);
    webview is a StageWebView instance with the viewPort defined. If I left it null, or didn't set the viewPort nothing happens...
    var webview:StageWebView = new StageWebView();
    webview.viewPort = new Rectangle(0,0,400,400);
    I'm now getting a login screen.

  • Html db use javascript

    Hi everyone,
    But using HTMLDB conditional display functionality, the buttons are there or not but not disable. I mean disable that you see the button but you can't launch a process because you can't access it.
    Thanks a lot. Bye.

    Hi Eric;
    We have an HTMLDB application with good amount of JavaScript. It has not caused us any problems and given us allot of capabilities. One of them is showing the total value of a series of fields as data is entered.
    We are internally having the debate on using JavaScript to replace built-in HTMLDB functionality such as field validation. One plus for JavaScript is it happens without HTMLDB having to render the page again. On the side of HTMLDB, it already does it “Out of the Box” very nicely with good UI
    As fare as “Enable and disable buttons” we have done this using HTMLDB conditional display functionality.

  • Tabbing with in textbox using javascript for html

    Assume a default date (mm/dd/yyyy)with in a textbox. On getting the focus to the textbox the focus should be on mm(should be highlighted), when it is replaced by a month, it should automatically focus on the date dd, when dd is replace it should get to yyyy. How to achieve this using javascript.

    Javascript != Javago ask on a Javascript forum.

  • How to pass value to pop up window using javascript function?

    I am not sure how to do this, I want to open new window from existing form,This is Mod/PLsql for consists some javascript functions also. When I am clicking on new window in form then new form should open with results of value entered,but new window form is opening with main page :( , not able to get text box value from parent form. How to call textbox input value in popup window from parent window using javascript?
    currently I'm using following code:
    HTP.p('<script type="text/javascript">
    function pop_up5()
    var l_url=window.opener.document.getElementById("p_single_store_pc").value;
    window.open(l_url, '''', ''fullscreen=no, scrollbars=1'');
    </script>' );
    Edited by: user11970612 on Jun 14, 2012 5:02 AM

    this is probably due to the Javascript code and not a "real link" to another page... I don't know if the null is due to the Javascript...
    But if you really really want to use javascript instead of a ... you can pass the location of the url with JSP (on your main page) as a parameter to the open window... (...) u can put instead of main.jsp <%= request.getServerName()+request.getRequestURI() %>
    the value <%= ... %> will return something like test.com/html/main.jsp
    Hope this helps.

  • How can I pass variables from one project to another using Javascript?

    Hi all, I am trying to do this: let learners take one course and finish a quiz. Then based on their quiz scores, they will be sent to other differenct courses.
    However, I wish keep track on their previous quiz scores as well as many other variables.
    I found this nice widge of upload/download variables by CPguru (http://www.cpguru.com/2011/05/18/save-and-load-data-widget-for-adobe-captivate-4-and-adobe -captivate-5/). However, this widget works by storing variables from one project in local computer and then upload it to another project.
    My targeted learners may not always use the same computer though, so using this widget seems not work.
    All these courses resided in a local-made LMS which I don't have access to their code. Therefore, passing variables to PHP html files seems not work.
    Based on my limited programing knowledge, I assume that using Javascript to pass variables may be the only possible way.
    Can someone instruct me how to do this?
    Thank you very much.

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

Maybe you are looking for

  • AP Down Payment Invoice not yet Draw Report

    Hi All, I'm trying to make a query of the AP Down Payment Invoice not Yet draw Report.  Can any one tell me which table I should refer when I need to make a query? I checked the ODPO tables that's no field indicate that the Downpayment not yet draw. 

  • Strange terminal command caching while manually running SWUPD.

    I've built dozens of software update servers with little issues. This one has me stumped today. I built a software update server to update solely our Tiger machines. Initially, I had sent a command to the clients that hit the wrong IP address. Once I

  • Cube/query name is not available in trx MDXTEST

    Hi All I was trying to use a custom BI query on top of infocube 0CP_SLSC6 as a source for mdx queries. I have set the property Allow External Access To This Query in BEx for the custom BI query. But in trx mdxtest I cant see the cube name in CATALOG

  • Use DB Connectivity tool, can I know the database is open by another user without opening it?

    hi all, A urgent issue here, is it possible for me to know whether the database is being used by the other user without opening a databse using Databae Connectivity Tool? Can anyone know the solution?

  • How to use Crystal report with Java

    Dear everyone, i am completely new to Crystal report , please can anyone help me to creat a very simple Report using the Crystal report, the report will show some records from oracle DB. How can i make it by a simple example and with code please? do