DP "something descriptive here will yield"

Discussion in 'JavaScript' started by dethfire, Aug 23, 2008.

  1. #1
    I'm trying to duplicate this DP function on my forums. I simply copied the code. It works fine until you preview a thread and then it resets the title. Here it doesn't happen. I don't see why it is different.

    <td><input type="text" class="bginput" name="subject" value="   [Something descriptive here will yield more responses]" size="52" maxlength="85" tabindex="1" onfocus="if(this.value=='   [Something descriptive here will yield more responses]')this.value='';" onblur="if(this.value=='')this.value='   [Something descriptive here will yield more responses]';"></td>
    Code (markup):

     
    dethfire, Aug 23, 2008 IP
  2. jack_ss

    jack_ss Guest

    Messages:
    94
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In your PHP (or whatever scripting language) code, you need to only put your default value if an existing subject does not exist.

    i.e:

    <input ... ... value="<?= $subject?$subject:" [Something descriptive here will yield more responses]"; ?>">

    Get it?
     
    jack_ss, Aug 26, 2008 IP