Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] One Editor, Multiple Edit Areas .....Event on Button click

Expand Messages
  • Steven Leopold
    hi Dav, I want to click the button right under the ..... , on event I still want the text insert into the editor. By
    Message 1 of 3 , Dec 4, 2008
    • 0 Attachment
      hi Dav,
       
      I want to click the button right under the <td> .....<input type=button..........> , on event I still want the <td> text insert into the editor.
      By default the <td>text is empty and I don't want the text "click me to edit the content" in there so by default the user cant see were to click.............need an other trigger for event (the input button).
      I wasn't able to modify the js on my one..........therefor I get hopefully help:)
      thanks


      From: Dav Glass <davglass@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Thursday, December 4, 2008 2:04:05 AM
      Subject: Re: [ydn-javascript] One Editor, Multiple Edit Areas .....Event on Button click

      I'm not sure what you are asking for, the script appears to be doing what you want.

      When you click on a TD it will insert that text into the editor. Is that not what you want?

      Dav

      --
      Dav Glass
      davglass@gmail. com
      blog.davglass. com


      + Windows: n. - The most successful computer virus, ever. +
      + A computer without a Microsoft operating system is like a dog
         without bricks tied to its head +
      + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine  +


      On Wed, Dec 3, 2008 at 4:34 PM, leopoldsteven <leopoldsteven@ yahoo.com> wrote:

      I used the "One Editor, Multiple Edit Areas" example and tried to modify the code so that the editor is showing the content of a <td> when clicking a button, but had no luck (I'm not a big js programer).

      asp site:

      while not rs.eof

      <

      tr><td class="editable">click me to edit the contents</td></tr>

      <tr><td><input type="button" id="btn_editable<%=loopcounter%>" value="edit" /></td></tr>

      loopcounter = loopcounter +1

      rs.movenext

      wend

      script js:

      Event.on(

      'editable_cont', 'dblclick', function(ev) {

      var tar = Event.getTarget( ev);

      if (Dom.hasClass( tar, 'editable')) {

      alert(

      'tar=' + tar.innerHTML)

      YAHOO.log(

      'An element with the classname of editable was double clicked on.', 'info', 'example');

      if (editing !== null) {

      YAHOO.log(

      'There is an editor open, save its data before continuing..', 'info', 'example');

      myEditor.saveHTML( );

      editing.innerHTML = myEditor.

      get('element').value;

      }

      YAHOO.log(

      'Get the XY position of the Element that was clicked', 'info', 'example');

      var xy = Dom.getXY(tar) ;

      YAHOO.log(

      'Set the Editors HTML with the elements innerHTML', 'info', 'example');

      myEditor.setEditorH TML(tar.innerHTM L);

      YAHOO.log(

      'Reposition the editor with the elements xy', 'info', 'example');

      Dom.setXY(myEditor.

      get('element_cont').get('element'), xy);

      editing = tar;

      }

      });

      the whole site is a printable page but there should be a possibility to add some text manually. everything is working fine when I dblclick the text "click me to edit the contents" but I don't want this default text there instead I'll have a button to click on and of course I want the editor to show the text from <td class="editable"> if there is a content. I modifed the script in a lot of ways but didnt find a solution.

      hope somebody can help me, thanks



    Your message has been successfully submitted and would be delivered to recipients shortly.