Announcement

Collapse
No announcement yet.

Replacing multiple buttons with images in the same form?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Replacing multiple buttons with images in the same form?

    Okay here's the deal, I'm trying to replace the "preview post" and "submit new thread" buttons in the "newthread" template with images, I need this for my skin.So very basically this is what vBull looks like at default:
    Code:
    <form action="newthread.php?do=postthread&amp;f=$forumid" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(this.subject.value, $vboptions[postminchars])"</if>>
    <lots of hidden inputs>
    <input type="submit" class="button" name="sbutton" value="$vbphrase[submit_new_thread]" accesskey="s" tabindex="1" />
    <input type="submit" class="button" name="preview" value="$vbphrase[preview_post]" accesskey="r" tabindex="1" />
    </form>
    and I want it to look something like this:
    Code:
    <form action="newthread.php?do=postthread&amp;f=$forumid" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(this.subject.value, $vboptions[postminchars])"</if>>
    <lots of hidden inputs>
    <input type="image" class="button" name="sbutton" src="images/post.gif" id="{$editorid}_save" value="$vbphrase[submit_new_thread]" accesskey="s" tabindex="1" />
    <input type="image" class="button" name="preview" src="images/preview.gif" value="$vbphrase[preview_post]" accesskey="r" tabindex="1" />
    </form>
    However this does NOT work because Internet Explorer discards the "value" statement or something (it does work in FF). Basically you cannot have multiple image submit buttons cuz then it messes up .
    I know this can be fixed by using javascript, but I cannot get it working.


    My javascript skills kinda suck so I ended up with stuff like this:
    Code:
    <input type="image" class="button" name="preview" src="/images/en_US/preview.gif"  onclick="javascript: document.vbform.submit.value('$vbphrase[preview_post]');return false;" accesskey="r" tabindex="1" />
    which didnt get me anywhere.
    You see the problem for me is that the "preview' button doesnt get registered correctly (or at all). Doesn't matter if I press "post" or "preview".... it gives the same result... the message gets posted.


    Any help would be appreciated.

  • #2
    Problem confirmed on my test forum. I don't know why it does that and I wasn't able to find a fix.

    If no one else here is able to help you with this small modification then I recommend you post on www.vbulletin.org.

    Comment


    • #3
      This is a known issue with IE, I've explained this on the irc chat from vbfans and the vborg channel to you. Nothing you can easily do about this.

      Comment


      • #4
        Yes I know Floris and thank you, but you also said you didn't know JavaScript well... so I thought I'd post it here too and see if someone with more JavaScript knowledge could find a solution

        Comment


        • #5
          That's fine of course. I hope you find out how.

          Comment


          • #6
            no luck so far, and I can't simply tell everyone to get rid of IE6

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X