Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Think You're good at Java? Heres a Challenge(calling all geniuses)

    Arlight friends, since you guys are so amazing at Javascripting I have a question for you. Because I need help. I've set up a system for submitting news etc and I have to interact with a database and so im using net.data code. Thats unimportant though. When The user is submitting news I am pretty much using forms. I want to make it so that when a user is typing in the form they have the option to highlight the text and click a button which will then add tags before and after the text. For example if my phrase were "the silly bunny". They would highlight it and click on bold and then in the form it would look like this :
    <b>the silly bunny</b> I need to make it this way so that the HTML code goes into the database. My problem is just that I dont know if its possible to do what I need, having tags go infrotn and after when you click on a button(java). This would be great if I could get some help on this! Thanks!

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.w3.org/TR/DOM-Level-2-Tra...ge/ranges.html (Range interface for Mozilla)
    http://msdn.microsoft.com/library/de..._textrange.asp (TextRange object for IE)

    Hope that helps!

    Happy coding!
    Last edited by nolachrymose; 05-27-2004 at 04:12 PM.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    www.vladdy.net/Demos/textareainsertion.html

    You call it a challenge? Try again

    EDIT:
    One note. You do not want to insert HTML directly for security reasons. Use pseudo-tags as this forum does and process them on the server.
    Last edited by Vladdy; 05-27-2004 at 04:12 PM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #4
    New Coder
    Join Date
    May 2004
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    You guys are great

    I could cry


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •