SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ajax retrieve text from db and replace inside wysiwyg

    On selecting an option from a select list i would like to retrieve data (html content) from mysql db according to selection and then replace everything inside my wysiwyg with that data.

    I know i can insert at selection a predefined value (just any old text):

    onChange="content.insertAtSelection (this.options[this.selectedIndex].value);"

    (this is how i can take some text and add it inside the wysiwyg at the cursor)

    How can i...

    1/ do the ajax retrieve part?
    2/ overwrite everything inside [this.selectedIndex]?

  2. #2
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no worries, done it

  4. #4
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    813
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have you check out some libaries like prototype, jquery or yui.

  5. #5
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually, i just used the tutorial from tizag.com Nice and simple ajax, 20 lines of code and a php file to do the query and echo the results


Bookmarks

Posting Permissions

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