SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question text area limits

    hi,

    my javascript below work perfectly on my localhost (WAMP) but dosen't work when i upload it to my host

    there is some very simple php linked to the page to check for blank fields should js be turned off, Could this be a problem???

    any ideas heres the code;
    .................................................................

    <td colspan="2">

    <textarea class="text" name="Message" rows="11" onKeyDown="limitText(this.form.Message,this.form.countdown,450);"
    onKeyUp="limitText(this.form.Message,this.form.countdown,450);">
    </textarea>
    <br /><font size="1">(Maximum characters: 450)<br />You have <input readonly type="text" name="countdown" size="3" value="450"> characters left.</font>

    </td>
    ....................................................................
    function limitText(limitField, limitCount, limitNum) {
    if (limitField.value.length > limitNum) {
    limitField.value = limitField.value.substring(0, limitNum);
    } else {
    limitCount.value = limitNum - limitField.value.length;
    }
    }

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    There doesn't seem to be anything in that code that would behave different depending on whether it run local or remote.

    We would need to take a look at what happens to it after you upload it to your host, in order to find out why it's not working on your host.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im not sure what you mean... Im just uploading it and the script file same paths as on my local.

    what do you need to look at?

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by minusten View Post
    what do you need to look at?
    Something that allows us to experience the same problem that you are facing, would be useful.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •