Help needed on freetextbox

  • 6 years 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

  • 6 years 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

  • 6 years 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

  • 6 years 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

  • 6 years 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. 

  • 6 years 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).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”