Community discussion forum

Help needed on freetextbox

  • 3 months ago

    Hi I am again in need of the professionals on this form. Thanks for the help in past. I have a freetextbox,a dropdownlist and a button in my application. when ever user selects a value in dropdownlist and presses button that particular value should be inserted on the cursor location in the freetextbox. if any one have any sample code or any idea as to how to achieve this please reply. Thanks

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 3 months ago

    Hi,

    I might be wrong, but when you leave the textbox, the cursor is no longer in the textbox, so its position will be lost.

    If you dont mind doing a postback, what you can do is:

    1. Add a hidden field to the form
    2. Use the following example: http://javascript.nwbox.com/cursor_position/ to get the cursor position
    3. Update the hidden field with the position of the cursor
    4. When the button is clicked, in the event
      1. Get the value of the textbox
      2. Get the value of the hidden control
      3. Split the string at the value of the hidden control
      4. rejoin the string with the value of the dropdownlist inbetween the 2 halves
      5. reassign the value to the text box?

    Does this make it any easier to get to a solution?  If you dont want a postback, then you will need to handle the onclientclick event of the button, find the dropdownlist, get the selectevalue and then mirror the same thing above in javascript.

    HTH

    Si

  • 3 months ago

    I am using freetextbox which does not provide onclientclick event. so how to call client side events for freetextbox like onkeyup, onkeydown etc.

    thanks for your replay. Hope u will soon reply with my requirement.

    Thanks again

  • 3 months ago

    Hi,

    I can't get on the freetextbox website to get the documentation so i can't help further than that at the mo.

    Sorry

    Si

  • 3 months ago

     Hi

    Thanks for your help.

    freetextbox website is now working , can you please help me achieve my requirement.

    waiting for your reply. thanks again. 

  • 3 months ago

    Hi,

    I downloaded the tool and have had a play with it.

    I can see that it renders iframes and textareas to do its work, but so far i can only edit the textarea object.  i have managed to attach the events from the example i showed above, unfortunately it doesnt seem to work on textareas.

    So i will need to do some more digging on that.

    I guess the next question is, do you just want to edit the textarea object, or do you want to edit the wysiwyg frame?  I am not sure you will be able to edit the latter is all.

    Si

Post a reply

Enter your message below

Sign in or Join us (it's free).