Results 1 to 4 of 4

Thread: HTML5 Notepad - How to modify this script?

  1. #1
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question HTML5 Notepad - How to modify this script?

    1) Script Title: HTML5 Notepad

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ml5notepad.htm

    3) Describe problem: Can this script be modified in a way that it can be used as a local phonebook? I replaced the textarea part in the script with a table with multiple text areas but when I click save only the input in the first text are is saved, all others are ignored. Any help on how to fix this? Or can another script be made?

    Live demo: www.yesilsms.com
    Paste url bar: javascript:rehber.loadpad('rehber',%20['right','center'])

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It's possible to either directly list multiple fields or loop through all fields in a certain form, but these are not stored anywhere permanently. Will this be helpful to the user?
    What you will need to do is modify the load and save functions significantly so that they either loop or list multiple elements. You can use the same basic structure as the current script, but this is a significant modification.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    How, for example? My javascript knowledge is close to zero... :/

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I don't have a working example. The explanation I gave was conceptual. It's possible, but not simple. As I said, it would be a significant modification. If you would like this, you could request it in a future update (if you aren't in a hurry), or you could post this in the paid work requests board (if you are in a hurry).
    If you aren't good with Javascript yet, this would be difficult to do.

    Listing multiple fields would be a little easier than looping, but it would be more work especially if the form might change sometimes-- is it always exactly 10 fields long (for example)?


    As a place to start, you'd need to modify this function so that the code to save a single field here would instead save many fields. You could duplicate the lines and change the IDs, but it might be a little more complicated than that. And for the loading I imagine it would be more complicated because you actually need to set the values of all the fields that way.
    Code:
    function savenote(){ //private savenote function
    			$pad.find('.title').text(formfields.$subject.val())
    			largestorage["notepad_"+id]=formfields.$subject.val() + "|||" + formfields.$content.val() //save subject and content fields, separated by "|||"
    		}
    For someone who is experienced with Javascript (probably more so than I am), this would not be especially difficult, though not "easy" either.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •