MyBB Community Forums

Full Version: Change code on the post_attachments_new template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to change the browse button But have been unsuccessful I have tried lots of things. I got this code but do not know how to get it to work with mybb correctly.

<div id="FileUpload">
    <input type="file" size="22" id="BrowserHidden" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" />
    <div id="BrowserVisible"><input type="text" id="FileField" /></div>
</div>
This code I have to get it working with post_attachments_new template
<tr>
<td class="trow1" width="1"><img src="{$theme['imgdir']}/paperclip.png" alt="" /></td>
<td class="trow1" style="white-space: nowrap"><strong>{$lang->new_attachment}</strong> <input type="file" name="attachment" size="30" class="fileupload" /></td><td class="trow1" align="center">{$attach_update_options} <input type="submit" class="button" name="newattachment" value="{$lang->add_attachment}"  tabindex="13" />
</td>
</tr>
I tried different ways of combining code but I can not get it function right Hoping someone can help with this.
O.k I got it to work all right using this code for the post_attachments_new template
<tr>
<td class="trow1" width="1"><img src="{$theme['imgdir']}/paperclip.png" alt="" /></td>
<td class="trow1" style="white-space: nowrap"><strong>{$lang->new_attachment}</strong> <div id="FileUpload"><input type="file" name="attachment" size="30" class="fileupload" id="BrowserHidden" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" /><div id="BrowserVisible"><input type="text" id="FileField" /></div></div></td><td class="trow1" align="center">{$attach_update_options} <input type="submit" class="button" name="newattachment" value="{$lang->add_attachment}"  tabindex="13" />
</td>
</tr>
But got a new problem with the .css I can not get it to look right
here is the .css I am using
#FileUpload {
    position: absolute;
    left: 210px;
    
}

#BrowserVisible {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 1;
    background:url(images/upload.png) 100% 0px no-repeat;
    height:26px;
    width:240px;
}

#FileField {
    width:155px;
    height:22px;
    margin-right:85px;
    border:solid 1px #000;
    font-size:16px;
}

#BrowserHidden {
    position:relative;
    width:240px;
    height:26px;
    text-align: right;
    -moz-opacity:0;
    filter:alpha(opacity: 0);
    opacity: 0;
    z-index: 2;
} 
and this is what i get
[attachment=29239]