User Profile

Collapse

Profile Sidebar

Collapse
phvfl
phvfl
Last Activity: Nov 9 '11, 11:42 AM
Joined: Aug 18 '07
Location: UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • phvfl
    replied to not getting focus in textarea.
    Should be working for you. Given html of
    Code:
    <div id="editorDiv" style="display:none;">
    <textarea id="myEditor" name="myEditor" cols="30" rows="6"></textarea></div>
    The following javascript should do what you want:
    Code:
      var container = document.getElementById("editorDiv"), editor = document.getElementById("myEditor");
    ...
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to using JS to tweak generated menu
    The innerHTML property is readonly once an element has been added into the DOM. To change the content the easiest way is to replace the content, this example assumes that there is only one child node of the div
    Code:
    // Get a reference to the DOM node
    var div = document.getElementById('foo');
    
    // Create the new text content
    var newContent = document.createTextNode('bar');
    
    // Replace the existing
    ...
    See more | Go to post

    Leave a comment:


  • I would personally use the approach suggested by Gits as this provides an nice solution. If you need to set the style directly on the element then you should use the display type "table-row", not "block" for showing the row
    Code:
    function showSchool(thing) {
             theSection = document.getElementById(thing);
             theSection.style.display = 'table-row';
     }
    See more | Go to post

    Leave a comment:


  • What does _myMethod return. The OnBeforeUnload event is usually used by assigning a string value to the event.returnVal ue property which is then displayed in an exit page prompt. So the following would show a dialog with the message "Page close prompt"
    Code:
    function pageClosing(e){
      // For most browsers
      e = e || window.event;
    
      // Ensure that the event object is not null
      if(e){
    ...
    See more | Go to post

    Leave a comment:


  • phvfl
    started a topic Alternate site over ssl

    Alternate site over ssl

    A little background information. I have a client that has two customer facing web applications, one is a public website and the other a customer site which requires authentication. This is two applications as one is based on third party code and the other is in-house code. The sites are in the same domain e.g. foo.com but different subdomains e.g. www.foo.com and bar.foo.com.

    My problem is that the wise people in the marketing department...
    See more | Go to post

  • phvfl
    replied to execCommand Trouble
    Have you tried passing the path to the image as the third arguement? I have also read that calling focus on the editable control resolves some issues on IE8. For example
    Code:
      var contentEditZone = document.getElementById('rte'); // the DIV with contentEditable=true
     contentEditZone.focus();
     contentEditZone.execCommand("InsertImage", true, imagePath);
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to C#.NET stored procedure call
    in .NET
    Not sure how Oracle handles varchar data. With MS SQL the declared size of the VARCHAR is an upper limit - if you had a VARCHAR with length of 1000 and used it to store 1 byte then the size in memory would be 1 byte (strictly speaking slightly more as the actual length of the value is stored).

    The client class in .NET uses the type enumeration to aid conversion between database types and .NET types - the native .net type will be a...
    See more | Go to post

    Leave a comment:


  • OK. Assuming that the text box is either an text input or textarea with an id of "myBox", this would mean html similar to:
    Code:
    <!-- A text input -->
    <input type="text" id="myBox" value="" />
    <!-- or for a textarea -->
    <textarea id="myBox" cols="10" rows="3"></textarea>
    You would be able to get a reference to...
    See more | Go to post

    Leave a comment:


  • Is the list variable on line 10 a global? I can't see it declared anywhere.
    See more | Go to post

    Leave a comment:


  • I assume that the textbox is either a textarea or standard text input box. Get a reference to the textbox using getElementById or similar and then check the value property.
    See more | Go to post

    Leave a comment:


  • If you want to hide a group of controls the easiest way is to hide a parent element which only contains those controls. This is not easy due to you using tables.

    Since it seems that you want to leave the table cells visible you will need to get a reference to each element and then set the style.display property to 'none' e.g.
    Code:
    /* Set the variable el to the html element using getElementById or similar
    el.style.display
    ...
    See more | Go to post

    Leave a comment:


  • Hi,

    You should be able to call it in the normal manner. You do not have a body tag in your content page but it will be in what is delivered to the client. Since JavaScript is executed on the client it will be able to access the body tag. You would be able to execute a function when the onload event is triggered using:
    Code:
    window.onload = OnLoadFunction;
    I assume that your placeholder is surrounded...
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to how to split a datalist bound item in asp
    in .NET
    As mentioned this is a rough template - the data source in the example was an array of strings. This means that each individual item was a string. If you are passing in a DataView then each item will be a DataRowView. You need to convert the "e.Item.DataIte m" object to the correct type - and in this case refer to the correct column to get your value....
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to how to split a datalist bound item in asp
    in .NET
    Example code

    Here is some example code - this is as basic as possible. There is no error checking - you will have to make this functional for the real world.

    Code:
    Partial Public Class _Default
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
        ' Create a fake data source
        Dim dataSource
    ...
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to C#.NET stored procedure call
    in .NET
    Glad you've got it working - it seems strange that you need to use the char type. What happens if you set the length on the parameter when the type is varchar? Example below setting the length to 100:
    Code:
     sqlCommand.Parameters.Add("MyEmplid", OracleDbType.Varchar2, 100).Value = emplid;
    ...
    See more | Go to post

    Leave a comment:


  • Hi,

    You are creating an instance of the ListOfThings class - but the member vThingObject is not having an instance created. i.e. Thing is not nothing but Thing.ThingObje ct is nothing.

    Assuming that ArrayOfThings has a parameterless constructor add the following to the ListOfThings class:
    Code:
    Public Sub New()
     vThingObject = New ArrayOfThings()
    End Sub
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to how to split a datalist bound item in asp
    in .NET
    Hi Bassem,

    Try using the ItemDataBound event of the datalist. You should be able to access each item being bound through the event arguments - the method is called once for each item in the data source. Using this method allows for more manipulation of the information in the code behind.

    Have a go - I'll provide some example code when I get a chance, not a my development machine at the moment.
    See more | Go to post

    Leave a comment:


  • phvfl
    replied to C#.NET stored procedure call
    in .NET
    CommandType

    Have you tried setting the CommandType of the command object to StoredProcedure ? I tend to have a ms-sql database but a similar error is thrown if the command type is not set.
    See more | Go to post

    Leave a comment:


  • I thought that the pages were not local as the OP said that they were not on their domain



    I suppose that this could be run through a "javascript:... " entered in the location bar.

    I could also be totally misunderstandin g and talking gibberish :)...
    See more | Go to post

    Leave a comment:


  • There are trailing spaces on the options that do not work:
    [CODE="javascrip t"]alert("no"=="no "); /* true */
    alert("no" == "no "); /* false */[/CODE]
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...