Javascript new thread title box like DP?

Discussion in 'Programming' started by touchAshley, Apr 20, 2009.

  1. #1
    I want my vbulletin forum to have the same function as dp on the new thread page:

    [​IMG]

    Then after clicking in the box:
    [​IMG]

    Here is the current code for the title box:

    <input type="text" class="bginput" name="subject" value="$subject" size="60" maxlength="$vboptions[titlemaxchars]" tabindex="1" />
    Code (markup):
    I found one code on vbulletin.org that works for this, but if you do a thread preview, the title goes back to the [Something descriptive here will yield more responses]
     
    touchAshley, Apr 20, 2009 IP
  2. kishore415

    kishore415 Well-Known Member

    Messages:
    1,462
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Try this code ..it works..

    <input type="text" class="bginput" name="subject" value="$subject" size="60" maxlength="$vboptions[titlemaxchars]" tabindex="1" onblur="if(this.value=='')this.value='   [Something descriptive here will yield more responses]';" onfocus="if(this.value=='   [Something descriptive here will yield more responses]')this.value='';"/>
    Code (markup):
     
    kishore415, Apr 20, 2009 IP
  3. touchAshley

    touchAshley Active Member

    Messages:
    1,762
    Likes Received:
    85
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Thanks. That does work, but [Something descriptive here will yield more responses] doesn't show in the field automatically. When you click in the title field and then click somewhere else on the page, THEN it shows up.

    Edit:

    Also, the code provided acts like a title. So that means when a member does'nt type in a thread title, then [Something descriptive here will yield more responses] becomes the title. DP doesn't do that
     
    touchAshley, Apr 20, 2009 IP
  4. touchAshley

    touchAshley Active Member

    Messages:
    1,762
    Likes Received:
    85
    Best Answers:
    0
    Trophy Points:
    90
    #4
    Alright, I just copied the code from dp directly (view source) and it works better, but it still reverts the thread title back to [Something descriptive here will yield more responses] when you click preview, and it still acts like a thread title, meaning you can post a new thread without entering a title because [Something descriptive here will yield more responses] becomes the title.

    This is really annoying!
     
    touchAshley, Apr 20, 2009 IP
  5. touchAshley

    touchAshley Active Member

    Messages:
    1,762
    Likes Received:
    85
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Still looking for a solution!

    If a mod could move this to the javascript forum, that would be good.
     
    touchAshley, Apr 22, 2009 IP
  6. Err0r

    Err0r Active Member

    Messages:
    337
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Also looking for solution, update us!
     
    Err0r, Apr 23, 2009 IP