Javascript on Lists - Resolved

I'm trying to get a javascript action integrated into a list (shared components>lists). I've tried using both the internal page references and URL options, but can't for the life of me find a way to get the javascript integrated with the link in a way that it will actually work.
What I want to do is link to a region on the page and show/hide the regions via javascript, like the page builder of Apex allows with the quick buttons on the top of the page rendering, page processing, shared components regions.
When I've tried using the URL option I put something like this in the URL field:
#DETAILS onclick="showRegions(this,'#DETAILS');return false;"
Of course apex thinks the whole thing is what ought to be double-quoted for the href attribute so it fouls up the javascript portion of the link.
I've also tried using the "User Defined Attributes", but those don't even seem to render with the list items. What am I missing here?
Earl
Message was edited by:
Earl

Hello,
Using the User Defined Attributes is the way to go with that as it gives you the best control on an item by item basis.
You just need to make sure to have the proper substituion tags in the list template.
#A01#...#A10#
so something like onclick="#A01#"
Regards,
Carl
blog : http://carlback.blogspot.com/
apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

Similar Messages

  • Using JavaScript & Dynamic Lists - ?? need help

    Hello all! Sorry to post this under an unrelated topic (JSP & JSTL), but there wasn't a JavaScript forum.
    Anyway, before I ask my questions...read the following:
    You'll find the code for my example at the end of this post. Also, I've posted my code as html pages in here...but my original code was in the form of servlets.
    Here's what I wanted to accomplish:
    1) html page has a form with two select lists
    2) select one option from the first select
    3) javascript code takes care of populating the 2nd list with options stored in an array, based on the first selection made in the 1st list.
    4) each <option>'s value is set to the page hello.html
    Piece of cake! That all works, but here's the real issue:
    Let's say you click on an option from the 1st <select> list, which populates the 2nd <select> list with some options. You then click on the 2nd box, select an option, and it jumps to hello.html.
    Now you press the back button - here are some things I observed:
    First, let me note, that for my example, I'm using car makes for the 1st list, and car models for the 2nd.
    * notice that only the 1st select list is still showing the selection you made, but the 2nd one shows nothing. Plus, when you click on the 2nd list, all that is shown is, in my example, "Then a Model". Not the original options that populated this list, when you had selected a car make from the first.
    *also, if you select "Then a Model" in the 2nd, it will error out, because there isn't a link set for that option. I would actually prefer that the page doesn't jump anywhere if "Then a Model" was to be selected. But I can probably fix that later.
    * If you try to select the car make you had previously selected again in the 1st menu, it still shows the same thing in the 2nd. Not the car models that it showed you when you had first run the example.
    *) You can get the model options for, just for example, "Acura" back into the 2nd, but you would have to select Audi or BMW and then select Acura again.
    *) if you select the "Select a Make" option in the 1st, it doesn't display "Then a Model" in the second as I would like. But I can probably fix that later.
    Now, here are my questions:
    1) Does anybody know how I can keep the selections "selected" in the page, when a user comes back to it when they press the "back" button?
    2) Do I have to store the options selected somewhere, so the page "remembers" what was selected?
    3) Would it help if I used session tracking?
    I was told that the problems I've described are because I've implemented a dynamic listbox.
    The value is supposed to be lost if I move to the next page and then click back. Would any of you agree?
    Any ideas/suggestions at all would be very much appreciated!
    ************************ HERE'S THE CODE **********************************
    This is dynamiclists.html I've commented it probably more than necessary for all you skilled JavaScript programmers, but I thought it would help to have an explanation for each piece of code.
    <html>
    <head>
    <script language=javascript>
    //here I create the multi-dimensional array to hold my
    //values for each make and model to be put into the
    //lists
    var cars = new Array();
    cars['Acura'] = new Array('Legend');
    cars['BMW'] = new Array('740i');
    cars['Audi'] = new Array('A4');
    //method used for my onChange event in the first select list (Make)
    //method accepts the value of the selected index
    function createModel(makeName) {
    //variables used for short-cutting to form elements
    //references the form
    var myform = document.selections;
    //Make selection list
    var Make = myform.Make;
    //Model selection list
    var Model = myform.Model;
    //holds the item selected in the first list -- ex. Acura or Audi
    var makeName = myform.Make.options[myform.Make.selectedIndex].value;
    //to be set to a new Option
    var theOption;
    //if Select a Make is selected, clear the Model select list, and just put
    // Then a Model in it
    if(Make.selectedIndex == 0) {
    Model.length = 0;
    Model.length = 1;
    Model.options[0].text = "Then a Model";
    Model.options[0].value="Then a Model";
    // if you select Acura from Make
    if(makeName == "Acura") {
    // fill first position in Model select list with the Then a Model, so the
    // user knows to select a Model after a Make
    Model.options[0].text = "Then a Model";
    Model.options[0].value = "Then a Model";
    // loop through the array elements that match makeName (which for example
    // could be Acura
    for(var i=0; i<cars[makeName].length; i++) {
    // create a new Option for each Model available
    theOption = new Option(cars[makeName], i);
    // put the Model into the Model select list starting at position 1, not 0 because
    // position 0 is taken up by Then a Model that was set above.
    // Thus why I put (i+1)
    Model.options[(i+1)] = theOption;
    // set each Model options link to hello.html, just for now.
    Model.options[(i+1)].value="hello.html";
    }//end for
    }//end if
    // repeat for BMW and Audi
    if(makeName == "BMW") {
    Model.options[0].text = "Then a Model";
    Model.options[0].value = "Then a Model";
    for(var i=0; i<cars[makeName].length; i++) {
    theOption = new Option(cars[makeName][i], i);
    Model.options[(i+1)] = theOption;
    Model.options[(i+1)].value="hello.html";
    }//end for
    }//end if
    if(makeName == "Audi") {
    Model.options[0].text = "Then a Model";
    Model.options[0].value = "Then a Model";
    for(var i=0; i<cars[makeName].length; i++) {
    theOption = new Option(cars[makeName][i], i);
    Model.options[(i+1)] = theOption;
    Model.options[(i+1)].value="hello.html";
    }//end for
    }//end if
    }//end createModel
    // this is for the onChange event in the Model selection list.
    // this takes care of the jump when you click on a Model.
    // you will be taken to hello.html, which has been set in each option above
    function MM_jumpMenu(targ,selObj,restore){
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"';")
    if (restore) selObj.selectedIndex=0;
    </script>
    </head>
    <body>
    <form name="selections">
    <select name="Make" onChange="createModel(this.options[this.selectedIndex].value);">
    <option value="Select Make" selected>Select Make
    <option value="Acura">Acura
    <option value="BMW">BMW
    <option value="Audi">Audi
    </select>
    <select name="Model" onChange="MM_jumpMenu('parent',this,0)">
    <option value="Then a Model" selected>Then a Model
    </select>
    </form>
    </body>
    </html>
    ***************************** END OF DYNAMICLISTS.HTML ***********************************
    Here's my simple hello.html
    <html>
    <body>
    Hello to all!
    </body>
    </html>

    I have a html:
    <html>
    <head>
    <script>
    var store = new Array();
    store[0] = new Array(
         'labas11',
         'labas12',
         'labas13');
    store[1] = new Array(
         'labas21',
         'labas22',
         'labas23');
    // Funkcija skirta dedant naujienu
    // irasa formuoti sarasa kuriems vartotojams bus siunciama zinute
    function populate()
         var box = document.forms[0].first;
         var number = box.options[box.selectedIndex].value;
         if (!number) return;
         var list = store[box.selectedIndex];
         if (list.length==null) return;
         var box2 = document.forms[0].second;
         box2.options.length = 0;
         for(i=0;i<list.length;i++)
              box2.options[i] = new Option(list,list[i]);
    function addGroup()
    var box = document.forms[0].first;
         var number = box.selectedIndex;
         if (number>-1)
    document.forms[0].third.options[document.forms[0].third.options.length]=new Option('[G] '+box.value,document.forms[0].third);
    function addUser()
    var box = document.forms[0].second;
         var number = box.selectedIndex;
         if (number>-1)
    document.forms[0].third.options[document.forms[0].third.options.length]=new Option('[V] '+box.value,document.forms[0].third);
    function removeOne()
    var box = document.forms[0].third;
         var number = box.selectedIndex;
         if (number>-1)
    box.remove(box.selectedIndex);
    function removeAll()
    // alert(document.forms[0].third.options[0].text);
    var box = document.forms[0].third;
         box.options.length=0;
    function selectToList()
    //this code selects all the elements in the select field
    for(var i=0;i<document.forms[0].third.length;i++)
    document.forms[0].third.options[i].selected=true;
    alert(document.forms[0].third.options[i].text);
    </script>
    </head>
    <body>
    <form action='servlet/List' method=Post>
    <select size=4 name="first" style="width:200px" onchange="populate()">
         <option value="0">html</option>
         <option value="1">css</option>
    </select>
    <select size=4 name="second" style="width:200px">
    </select>
    <select size=4 name="third" style="width:200px" multiple>
    </select>
    <input type=submit value=spausk onClick="selectToList();" />
    </form>
    <table>
    <tr><td><button onclick="addGroup()"> &#302;d&#279;ti grup&#281; </button></td></tr>
    <tr><td><button onclick="addUser()"> &#302;d&#279;ti vartotoj&#261;</button></td></tr>
    <tr><td><button onclick="removeOne()"> �alinti </button></td></tr>
    <tr><td><button onclick="removeAll()"> I�valyti </button></td></tr>
    </table>          
    </body>
    </html>
    and servlet:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class List extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
         { doAction(request,response);}
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
         { doAction(request,response);}
         public void doAction(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
              response.setContentType("text/html;charset=windows-1257");
              PrintWriter out = response.getWriter();
         String[] strArray=request.getParameterValues("third");
              out.print("Value: "+strArray[0]);
    So what is wrong because servlet prints bad value [object]
    Thanks

  • Javascript / Select List with Submit problems

    I have a page (page 3) where I can either edit or create a record. If I am editing a record, the data loads on page 3 via a PL/SQL block. On page 3, I have a textual item with Javascript linked to it which pops up a new window. In the Javascript, I am passing three values to the next page. Two of those values (P3_ITEM1, P3_ITEM2) are 'Select List with Submit'. If I am creating a new record from page 3, the Javascript works fine and the popup window comes up when I click on the textual item. However, if I am editing an existing record, I get an error when I click on my textual link. Looking at the address bar, it is not passing the value of P3_ITEM1 and P3_ITEM2 to the next page. It does, however, pass the value of P3_ITEM3 (not a 'Select List with Submit') to the next page. Again, the Javascript popup works fine if I use the 'Select List with Submit' fields to populate P3_ITEM1 and P3_ITEM2 (i.e. if I submit those fields) and it does not work if P3_ITEM1 and P3_ITEM2 are already populated when page 3 loads (i.e. if I do not submit those fields). Looking at the session variables, it appears as though P3_ITEM1 and P3_ITEM2 are set prior to clicking the link which initiates the Javascript. However, the URL in the popup window says the value of those fields is 'undefined'. Does anybody have any idea what I can do to make this work or why it is not working? Thanks.
    -Chris

    Hello Chris,
    It seems like you are having some problem with setting/reading session state, but it’s really hard to pin point the problem without seeing any code. Can you post your two pages on apex.oracle.com?
    Regards,
    Arie.

  • JavaScript - Update List Element SharePoint 2010

    Hello guys,
    I have a list and in that list I have to compare Today date and an valid until date.
    If this valid until - today <= 0  then the value is yes/no if value is yes then an email shoulde be sent a specific person.
    How can I do that with JavaScript? If I change the variable is it also activ in the SharePoint Workflow?
    Best regards
    Matthias

    Hi Matthias,
    You can set the workflow to be triggered when item changed, then when the value is changed in one item, workflow will be triggered automatically and execute the logic to send
    email accordingly. 
    Thanks 
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Javascript calculations not resolving properly

    Hi,
    I am currently making a PDF that makes labels for products based on what is entered on the first page.
    I have been running it ok for a while and just printing off tests, now out of no where after no changes some of the calculations are not resolving.
    For example I have a row of coloured tick boxes to show what colour the product is, on the label it is typed out twice once in an abbreviation for a product code then in full for the description.
    I have noticed that now some of the colours won't register with the label until you check the next one and sometimes it will be delayed by 1.
    I have come across this problem before and was unable to fix it, I have tried chaining the calculation sequence but to no avail.
    Is there anything else I can do to fix this?
    Thanks,
    Bruce

    Hi,
    Sorry for the late reply.
    I had ago at this when I saw it but I seem to be getting the wrong output from it and I am not sure as to why this is.
    I am using the colours as I have found that only the colours seem to not work properly.
    if(this.getField("Colour").value=='MB'){
    event.four = "MEDICAL BLUE"
    } else if (this.getField("Colour").value=='LB'){
    event.four = "LIGHT BLUE"
    } else if (this.getField("Colour").value=='CR'){
    event.four = "CREAM"
    } else if (this.getField("Colour").value=='GR'){
    event.four = "GREY"
    } else if (this.getField("Colour").value=='MG'){
    event.four = "MEDICAL GREEN"
    } else if (this.getField("Colour").value=='LI'){
    event.four = "LILAC"
    } else {
    event.four = "?"
    I seem to only get the abbreviated text as a result and not what I defined and reason why this is?
    I am using radio buttons for the colour if this makes it any different?
    Thanks,
    Bruce

  • Listing Document Libraries using JavaScript

    Is it possible to use JavaScript to list all document libraries of a site? I would like to create a page that lists all document libraries (where the document library's name meets certain criteria).
    Johan Raeymaeckers

    You can use the Object Model to do this.  MS have authored an article that explains it better than I can here.  It has quite a few interesting other tricks too.
    http://msdn.microsoft.com/en-us/library/hh185009
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Firefox doesn't list javascript in preference  content. How do I enable javascript?

    "Enable javascript" not listed as an option on firefox content preferences. How do I enable javascript?

    That option had been removed a long time ago; now you use about:config in the address bar, then set javascript.enabled to true:

  • Why does my javascript code work fine in all other browsers, but not Safari

    Previously, I have asked how Safari handles javascript trying to resolve a problem with a slide menu, (http://www.designoutput.com/testslide.html) being directed to validator. I have corrected as many things as possible and still have code work in other browsers. Why will my code work in all other browsers (IE 5.2, Firfox, Netscape, and Opera) and not Safari. It appears that Apple would address some of the problems that people are listing. Possibly, my problem is not with Safari, but my code, if so why does it work in all other browsers. Having more knowledge of how Safari accepts code or handles code differently than other browsers would be helpful. It would be nice if I could debug my code in Safari step by step to know where the problem is at. I'm just frustrated with Safari after working on my problem for over a month. Would be very greatful to anyone that could just being to get my code to appear in Safari (only a blank page in Safari, menu appears in all other browsers)
    G4 AGP 400, Powerbook G4, G4 Siver 733   Mac OS X (10.4.7)  

    you seem to have deleted even more end tags. elements (<a>, <div>, <td>, etc.) need to be closed (</a>, </div>, </td>, etc.) to structure the code properly.
    incorrect:
    document.write(<font ...><b>example)
    correct:
    document.write(<font...><b>example</b></font>)
    check out w3schools for html and javascript help.
    the ilayer tag should only be in your NS (i.e. not NS6) code, but it too needs to be closed.
    i don't use IE, but with these fixes i've gotten your page to display fine in safari, firefox and opera.
    iBook g4     OS X.4.x

  • Custom Sort Order in Dropdown list of translate values

    Peoplesoft sorts the dropdown translate values in ascending order by default. I wanted to change the sort order. For example:
    The translate values in alphabetic order are:
    Andrea
    Baluch
    Others
    Shumi
    I want this "Others" as the last value. So the drop down should display like this:
    Andrea
    Baluch
    Shumi
    Others

    From a document I had created ...
    This odd behavior of PeopleTools however can be overridden by implementing a few lines of JavaScript and PeopleCode.
    The approach is quite simple and summarized briefly as below:
    1.     Concatenate the value-description pairs of the dropdown list into a single string separated by a pipe “|” as delimiter (in case other delimiter is used the script shown below in Step 4 has
    to be accordingly modified) in the sequence in which it should be displayed on the page.
    2.     While concatenating, make sure to place the value first and then the description, these being separated by the delimiter. Example: “01|”|”January”|”02|”February” …and so on.
    3.     Pass this string as a parameter to an HTML definition through a GetHtmlText function. This HTML definition in turn will a have a JavaScript logic to resolve this delimited string into
    meaningful value-description pairs and use them to override the intended dropdown list.
    Below are the steps in detail:
    Step 1:
    Find out the html element-id for the dropdown field from the html source-code of the PeopleSoft page from the browser. In HTML, the tag for a dropdown field is <select> </select>
    The element-id is set by the id attribute of the <select> tag. This id would be used in Step 5.
    Step 2:
    Add a field of type Long Character to any work record that you may be using on your page for buttons, hyperlinks, etc.
    Step 3:
    Add an HTML-Area to the page (preferably alongside the dropdown field which needs need to be sorted). In the properties of the HTML-Area, assign the Record-field used in Step 2 above.
    Step 4:
    Create a HTML definition from the app-designer and add the below JavaScript code to it and save the definition.
    <script>
    var j=0;
    var str=new String('%bind(:2)');
    ar1=str.split("|");
    var fld = document.getElementById("%bind(:1)");
    fld.options.length = 0;
    fld.options[fld.options.length] = new Option('', '');
    while (j<ar1.length)
              fld.options[fld.options.length] = new Option(ar1[j+1], ar1[j]);                      
                    j=j+2;
    </script>
    Step 5:
    Write peoplecode on an appropriate event to generate the concatenated string of value-descriptions delimited by a pipe “|”. A pseudocode for the same is shown below. Here the HTML id for the dropdown field and the value-description string are passed as parameters to the JavaScript shown in Step 4; and JavaScript thus created after substitution of the Bind values is assigned to the value of Record.Field used in Step 2 & 3. The location of the below peoplecode may vary depending on the when the dropdown list needs to be sorted.
    Local string &strDropdownValues;
    &strDropdownValues = "1|" | "January|" | "2|" | "February|" | "3|" | "March|" | "4|" | "April|" | "5|" | "May|" | "6|" | "June";
    <Record.Field>.Value = GetHTMLText(<HTML.DPS_DROPDOWN_HTML>, "<DROPDOWN_ID>", &strDropdownValues);

  • Document-level Javascript as Object

    I created a document level script called Utility.
    I want to create methods within this script rather than coding each one separately.
    function Utility()
    this.getFormattedDateOnly=function(pDate) {
      if (typeof pDate == "undefined") {
        pDate = new Date();
      var retval = util.printd("m/dd/yyyy",pDate);
      return retval;
    this.getFldsOnPagenum = function(pPageNum, pDoc) {
      /* returns an array of the form fields who are on or start on a page */
      /* zero based return ; however pPageNum is 1 thru numPages, not 0 -> numPages-1 */
      var currPage;
      var currFld;
      var cnt = -1;
      var ARflds = [];
    CPR("# flds=" + pDoc.numFields+" Type of pDoc:"+ (typeof pDoc));
      for (var i = 0; i < pDoc.numFields; i++) {
        currFld = pDoc.getNthFieldName(i);
        if (typeof currFld.page == "number") {
    CPR("page="+(1*currFld.page+1));
          if ((1*currFld.page+1) == pPageNum) {
            cnt++;
            ARflds.length = cnt + 1;
            ARflds[cnt] = currFld;
    CPR("\n cnt="+cnt);
        } else if ((1*currFld.page[0]+1) == pPageNum) {
          cnt++;
          ARflds.length = cnt + 1;
          ARflds[cnt] = currFld;
      return ARflds;
    var MyUtil = new Utility();
    This is all working fine with the following exceptions:
    1) the methods are not being registered in the Javascript hierarchy listing.
    That's annoying.
    2) "This" is not recognized at the document level....I must pass it as a parameter (pDoc).
    I thought that was strange...I could see it if were at the folder level.
    It appears the document object is out-of-scope !!
    3) currFld = pDoc.getNthFieldName(i);
    The above is failing....sending back a "currFld is undefined" error.
    I don't see the problem....very strange IMHO.
    When I call the getNthFieldName function from the console....no problem.
    What am I doing wrong in the definition here ?
    It appears that what I did has Acrobat functions and document properties out-of-scope.

    I think this would work if you could make the document object a member of the Object being created.
    To do that, a constructor needs to be invoked so that it can instantiate a public property of the Object.
    var MyUtil = new Utility(this);
    inside of Utility I would have:
    this.oPDFdoc =  this;
    thereby transferring a reference to the entire PDF document to my Object.
    Getting this to work would eliminate the need for all of the document-level javascript references.

  • Can javascript pass values to applet inside jar file?

    I have an applet that receives the computer name selected via javascript and then resolves the name with the name server and returns any available ip addresses (via a browser). When running this applet unsigned, I can only resolve my own local machine and I get security exception errors(access denied) for any other computer selections (this would be expected).
    I have created a jar file encompassing the class file and java file for this applet signing it with the designated signature. When using the jar file, the applet will start, but no names can be resolved (including the local machine) and there are no errors on the java console...(???)
    HTML code is as follows:
    <html>
    <body>
    <form>
    <fieldset style="width:100%"><legend>  ?</legend>
    <select name="CNList"
    onChange="var f = document.forms[0]
    if (f.CNList.options[f.CNList.selectedIndex].text=="") {
    alert("Please choose a computer name for this test.");
    f.CNList.focus();
    return false;
    }else{
    var cnv = f.CNList.options[f.CNList.selectedIndex].text;
    document.myApplet.newText(cnv);
    return false;"
    >
    <option value="-SELECT COMPUTER NAME-" selected>-SELECT COMPUTER NAME-
    <option value="BELKNAP">BELKNAP
    <option value="DOWNS">DOWNS
    <option value="GSIMS">GSIMS
    <option value="SPOTSYLVANIA">SPOTSYLVANIA
    <option value="CEDAR">CEDAR
    <option value="BELLMEAD">BELLMEAD
    <option value="ASHLAND">ASHLAND
    <option value="COMFORT">COMFORT
    <option value="ROSS">ROSS
    <option value="PUTNAM">PUTNAM
    <option value="CHARITY">CHARITY
    <option value="FRODO">FRODO
    <option value="PLUTO">PLUTO
    <option value="DENTON">DENTON
    <option value="HOOD">HOOD
    <option value="KODIAK">KODIAK
    <option value="SUNDOWN">SUNDOWN
    <option value="FROST">FROST
    <option value="TRINITY">TRINITY
    <option value="LOUDOUN">LOUDOUN
    <option value="MPAPE">MPAPE
    <option value="QUENTIN">QUENTIN
    <option value="DUNDEE">DUNDEE
    <option value="SIGMA">SIGMA
    <option value="PSI">PSI
    <option value="CUBE">CUBE
    <option value="ALOHA">ALOHA
    <option value="OBION">OBION
    </select>
    <br />
    <applet code=NSQuery2.class
            archive="NSQuery2.jar"
            width=400 height=250
         name="myApplet"
         id="myApplet"
         >
         <p>Sorry, you need a Java enabled browser to see the applet's info.</p>
    </applet>
    </form>
    </body>
    </html>JAVA Applet code is as follows:
    /* Gets ComputerName selected, returns IP Address(es)*/
    // Instead of importing just 1 or 2 parts of java.awt and java.applet classes,
    // we have chosen to import everything at once.
    // To do this we use the wildcard operator (*).
    import java.awt.*;
    import java.applet.*;
    import java.io.*;
    import java.lang.String;
    import java.net.InetAddress;
    public class NSQuery2 extends Applet {
    // This declares a string variable named computerName for future use.
    String computerName;
      public void init() {
      // Set background color of our applet to white.
      setBackground(Color.white);
      public void paint(Graphics g) {
        super.paint(g);
        try {
          g.drawString("Computer Name: " + this.computerName, 23, 43);
          String[] ips = new queryhost().getIPAddressArray(this.computerName);
            for (int j=0; j<ips.length; j++) {
          g.drawString("IP Address   : " + ips[j], 23, (12*j)+((j+10)+91));
        } catch (Exception e) {
                g.drawString("Can't detect selected host name.  Check Network settings.", 23, 60);
       public static void main(String[] args) { new NSQuery2(); }
       public static String[] getIPAddressArray(String computerName) {
       //create int which is (sRemoteHost.length() + 1)
       int sRemoteHostchars = computerName.length();
         sRemoteHostchars++;
        //below returns a array of type InetAddress which holds entries such as: hostname1/IPAddress1 etc
       InetAddress[] remoteHostName = null;
       try {
          remoteHostName = InetAddress.getAllByName(computerName); // get IP Address(es)
       catch (Exception e) {
          e.printStackTrace();
        // below creates an array of type string which holds entries such as : IPAddress1 etc
        String[] remoteIP = new String[ remoteHostName.length ] ;
        for (int i=0; i<remoteHostName.length; i++) {
           String iponly = remoteHostName.toString();
    iponly = iponly.substring(sRemoteHostchars);
    remoteIP[i] = iponly;
    return remoteIP;
    public void newText(String s){
    this.computerName = s;
    repaint();
    Anyone have any ideas as to why this can't be performed?
    Thanks in advance,
    Geoff-

    Hey thanks for the response (seems that most responses
    are gender specific around here :) )!No, they are not. Ask a good question (not "do my homework for me") and ask it specifically, and you will get good help whatever your gender. I am a girl; I make no attempt to hide this. I have always gotten good, solid advice from this forum without any reference to my gender, without any ascerbic remarks, without scorn from the respondant.
    You are probably referring to the "girl needs som help" thread or other recent threads from girls (well maybe girls, who knows).
    The content of these posts were:
    1) asking to help with blatant cheating on homework
    2) extremely vague
    3) used the OPs gender as an excuse for 1) and/or 2)
    Using your gender as an excuse for being unable to put code together and requesting help with cheating:
    -implies girls are too stupid to do math, programming, engineering
    -implies that girls who are in these fields are freaks/mutants/other
    -implies that gender is an exucse for laziness
    -implies that girls cannot think logically
    -implies that girls do not have to follow rules of integrity, or that girls have no integrity
    Such posts understandibly raise the ire of women software engineers who have worked hard to get where they are. (And also of male software engineers who can see through the request as a play on a stereotype)
    It is akin to a girl coming to my office hours and saying "I have my mechanics final exam tomorrow, but I didn't study all semester because I'm a girl and math is too haaaaard"
    Honestly, I would try to help the girl as much as I could, not because she's a girl, but because it is part of my duty, my responsibility, to help students.
    But before I could do it, I would have to count to ten a few times to get my temper under control.
    jen

  • Dynamic Dropdown / PHP / MySQLi / Javascript Problem

    I have 2 pages, namely main.html and list.php The Main Pageincludes the following code and consists of a dropdown that i want to pull some database records into by calling the function fillCategory contained in list.php
    Content on main.html
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <head>
    <title>Page Title</title>
    <script language="javascript" src="list.php"></script>
    </head>
    <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onload="fillCategory();">
    <FORM name="drop_list" action="yourpage.php" method="POST" >
    <SELECT NAME="Category" >
    <Option value="">Category</option>
    </SELECT> 
    </form>
    </body>
    </html> 
    Content of list.php
    <?php 
    require_once('mysqli_connect.php');
    echo "
    function fillCategory(
    $q="select * from category"; 
    echo mysqli_error($dbc); 
    $r=@mysqli_query($dbc,$q); 
    while($row=mysqli_fetch_array($r,MYSQLI_ASSOC)){
    echo "addOption(document.drop_list.Category, '$row[cat_id]', '$row[category]');";
    ?> 
    I know that records are being pulled from the MySQL database since when i view 127.0.0.1/list.php i can see the following diplayed on the page: 
    function fillCategory( addOption(document.drop_list.Category, '1', 'Sport');addOption(document.drop_list.Category, '2', 'Music');addOption(document.drop_list.Category, '3', 'Art'); 
    which are the contents (Sport, Music, Art) that i'd like to appear in my dropdown. However, i suspect that i shouldn't see the above being displayed in list.php Instead, it should probably be passed to main.html "unseen". Can anyone point out the probable error in my syntax. I can provide more detail on the database structure if it will help. 
    Thanks,
    Mark

    I think that this is the line in error:
    <script language="javascript" src="list.php"></script>
    The <script> tag is generally used to include client-side script. I believe that PHP will recognize on the server-side, but you need to change "javascript" to "php". You may want to use a PHP include or require statement, instead.
    Also, you might need to remove the "<?php" and "?>" delimiters from list.php.
    HTH,
    Randy

  • Converting JavaScript "Variables"/Functions into Designer 7

    Hi,
    I'm upgrading our Forms which were created in Adobe 6 to Adobe 7 with Adobe Designer 7. One of the biggest problems that I'm encountering is the function library we developed in-house, which now shows under 'variables' at the Form level. The whole library was written in JavaScript.
    Listed below is a sample function:
    ----- F.#variables[0].DL_resetDefaultColor::DL_resetDefaultColor - (JavaScript, client) ------------
    # This function resets all the field elements to its default color ***************************************************************/ function DL_resetDefaultColor()
    //Get the array of all the form field elements names
    rArray = DL_getFormElements(); //Calling another function
    for (var i=0; i < rArray.length; i++) { DL_setDefaultColor(rArray[i]); } }
    Most of these functions are called from Button::mouseUp events, however when the button is clicked the Debugger gives the following error:
    TypeError: DL_resetDefaultColor is not a function
    6:XFA:F[0].P1[0].button_name[0]:mouseUp
    Please help in explaining how I may do this with Designer.
    Thank you,
    Ali

    Do you have this fixed yet?

  • Links2 -g javascript issue [solved]

    I installed the community build of links2 -g as my backup web browser and to view html files on my computer.  The web site describes javascript capability and their manpage indicates a setup box for adjustments.  The PKGBUILD in ABS indicates that it should be compiled in?  not sure about this. (I'm new)  There is no setup box for javascript under setup and when I go to a website that definitely has javascript I get the "please enable or switch browser messages".  I checked with Firefox/Noscript enabled and it reported the same message until I gave permissions.
    Is this feature turned off due to security issues? Can I reset something in ABS to rebuild with javascript enabled?  Any help would be appreciated. 
    Thanks
    javascript was listed as buggy on website.
    Skippy
    Last edited by skippy (2008-02-16 05:01:15)

    I am seeing some similar weirdness in manually created tabular forms using apex 3.2 and 4.01. I have an order form where the f01 .. f09 items get saved in a collection when the user hits the next button (collection is truncated then rebuilt using ...add_member). If they go back to the tabular form with the previous button the quantity entered for a particular row in the form gets moved down to the next row. You can hit next and previous and it will keep on happening. Eventually the quantity entered will cycle through all the html rows and back to the top. It does not happen with IE 8, FF 3.6 or Chrome. It is like the fXX items are not properly sequenced in the html form. I have spend hours trying to figure this out to no avail. The only variable is FF 4. I've tried 5 different themes. No luck.
    Dave

  • Auto-Increment ID for the Sharepoint 2010 List

    Hi,
    I have a requirement to have a SharePoint List with set of fields. One of the field should store the Custom ID field Ex: "2015-001". Numbers should auto increment the values i.e 011, 002 and so on.
    Can someone help me to achieve this requirement via Out-of-box.
    I tried using [ID] field and tried concatenating to bring up the value as "2015-001" but it didn't work and I read that [ID] field does not work as expected with the calculated column.
    I am aware there SP Designer workflow solution, JavaScript solution, List Adding Event Receiver solutions are available. I trying to find if there is any out-of-Box solution available.
    Share your thoughts/suggestion on this requirement

    Thanks Alex.
    We have used Infopath and we were able to achieve the Auto Increment requirement.
    There is another requirement:
    Created By and Created should be stamped together in the list. Ex: Field Name: Audit Trails - XXX,03/06/16/15, 05:08PM.
    I tried creating a field and used formula to concatenate Created By and Created field...but, When I Submit the form in Sharepoint List, Audit Trail Field is empty.
    I tried Submit/Receive data etc..but no luck
    Any Suggestions or thoughts?

Maybe you are looking for

  • Simple Program - Day Number

    Hi, I am trying to pick up java...and need help with a program I want to be able to figure out the number of days into a year from a date -- for example - user input - year - 2001 month - 01 day 01 the output would be 1... and for dec. 31, 366 (depen

  • Designate data points in scatter plots

    Hey, I`ve made a correspondence analysis in excel and want to get a scatter plot as .eps-file. I`ve imported the X and Y values in Illustrator and created a scatter plot. Now I would like to represent the numbers of data points (like in the illustrat

  • Unable to view reports in Telesales

    Hi, I am unable to view any standard reports from Telesales and Telesales Agent responsibility. Is there anything do I need to view the standard reports. Please guide as I am new to this module for implementation Thank you

  • Application.properties

    Hi, My application is based on struts frame work. I am writing application.properties file to Internationalize the messages. Now i am strucked in between. i want to add html tags between the messages in application.properties file for example... new.

  • How Do I Save My Default Profile Settings?

    Hi - this is driving me crazy so there obviously is a simple answer that I just can't find. In the Develop Module I want to enable Lens Correction and Camera Calibration (from Adobe Standard to Camera Standard) and keep those settings as my Default P