SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Guidance Needed

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    446
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Guidance Needed

    Guidance Needed.,

    I have an input box that's 200px long in a php form. There's no room in the form, to make the input box bigger. Long input in difficult to edit in this small box so I use a word processor to edit long input when I need to.

    Is there some way to use JS (or some other approach) to trigger a pop-up that's large enough for easier editing that might even include a spell checker?

    If so, how should I begin to think about making this improvement?

  2. #2
    SitePoint Addict tlacaelelrl's Avatar
    Join Date
    Apr 2011
    Location
    Mexico city, Mexico
    Posts
    353
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nichemtktg View Post
    Guidance Needed.,

    I have an input box that's 200px long in a php form. There's no room in the form, to make the input box bigger. Long input in difficult to edit in this small box so I use a word processor to edit long input when I need to.

    Is there some way to use JS (or some other approach) to trigger a pop-up that's large enough for easier editing that might even include a spell checker?

    If so, how should I begin to think about making this improvement?

    I donīt understand very well what you need, can you post the code you have at the moment or a link to the form?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i would add an onclick trigger to the textfield and send it to a function that uses some sort of shadowbox, etc and then return the info to the original field

    maybe another option would be to float the textfield and onclick enlarge the textbox overtop of the form by requesting and changing the height/width property and then changing it back on some other event

  4. #4
    SitePoint Addict tlacaelelrl's Avatar
    Join Date
    Apr 2011
    Location
    Mexico city, Mexico
    Posts
    353
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can definitely achieve that with onfocus and do some javascript function to change the CSS rules applied but donīt know what you have so there is no way for me to give you a sample

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah that makes more sense using onfocus
    i'm assuming onfocus returns a boolean, if not you can create one for it
    something like...
    Code:
    if(onfocus){
        this.getElementById("textfield").width = 500px;
        this.getElementById("textfield").height = 500px;
                if(!onfocus){
                        this.getElementById("textfield").width = **original**
                        this.getElementById("textfield").height = **original**
                }
    }


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
  •