Topic: using a URL in an input field

Can someone tell me why the code below works in FF but not in IE and if ther eis a solution for it.

<a href="javascript:ShowMenu('bbcode_remote.php','window2',260,350,0,0);"><input type="image" src="img/editor/color.png" alt="colors" title="colors" class="button" onmouseover="helpline('colors');" onmouseout="helpline('default');" /></a>

The problem I am having is this. The popup window works in FF but I get the following error when I click in the image using IE:

"Message is a required filed in this form"

Thanks in advance.
Bingiman

Re: using a URL in an input field

http://webdesign.about.com/od/htmltags/ … putimg.htm
<input type=img> acts as a submit button. That's not what you want. Use an image tag wink

Re: using a URL in an input field

If I use an image tag then I don't get the same effects as the input buttons. All my input buttons use a class="buttons" which all have a border around it. Now, I know I could use style="border: 1px etc... and so forth but I just wanted to use the input becuase if I hard code a style in there then my border will black for all themes. Hope you follow what I am trying to say. I thought maybe there was a way around it...?

Bingiman

Re: using a URL in an input field

There isn't other than moving it out of the form, because clicking on the button is the same as clicking a submit button

Re: using a URL in an input field

I bit the bullet and just added a style to the image. I'll just have to create a separate class in each theme stylesheet for that image border. This is the result I was trying to accomplish:

http://shedrockonline.com/downloads/effect.gif

Re: using a URL in an input field

I'm confused why clicking on those other buttons wouldn't submit a form though

7 (edited by bingiman 2007-04-30 01:11)

Re: using a URL in an input field

Well it does work. but what I was trying to do was this. Here are all the other buttons in the bbcode file:

<input class="button" type="image" onmouseover="helpline('email');" onmouseout="helpline('default');" src="img/editor/email.png" alt="email" title="email" onclick="insert_text('[email]','[/email]') ;return false;" />
<input class="button" type="image" onmouseover="helpline('b');" onmouseout="helpline('default');" src="img/editor/bold.png" alt="bold" title="bold" onclick="insert_text('[b]','[/b]');return false;" />
<input class="button" type="image" onmouseover="helpline('i');" onmouseout="helpline('default');" src="img/editor/italic.png" alt="italic" title="italic" onclick="insert_text('[i]','[/i]');return false;" />
<input class="button" type="image" onmouseover="helpline('u');" onmouseout="helpline('default');" src="img/editor/underline.png" alt="underline" title="underline" onclick="insert_text('[u]','[/u]');return false;" />
<input class="button" type="image" onmouseover="helpline('s');" onmouseout="helpline('default');" src="img/editor/strikethrough.png" alt="strikethrough" title="strikethrough" onclick="insert_text('[s]','[/s]');return false;" />
<input class="button" type="image" onmouseover="helpline('h');" onmouseout="helpline('default');" src="img/editor/highlight.png" alt="highlight" title="highlight" onclick="insert_text('[h]','[/h]');return false;" />
<input class="button" type="image" onmouseover="helpline('url');" onmouseout="helpline('default');" src="img/editor/url.png" alt="url" title="url" onclick="insert_text('[url=Page URL]Page Name','[/url]');return false;" />
<input class="button" type="image" onmouseover="helpline('youtube');" onmouseout="helpline('default');" src="img/editor/youtube.png" alt="you tube" title="you tube" onclick="insert_text('[youtube]','[/youtube]');return false;" />
<input class="button" type="image" onmouseover="helpline('google');" onmouseout="helpline('default');" src="img/editor/gvideo.png" alt="google video" title="google video" onclick="insert_text('[googlevid]','[/googlevid]');return false;" />
<input type="image" src="img/editor/smilies.png" alt="smileys" title="smileys" class="button" onmouseover="helpline('smileys');" onmouseout="helpline('default');" onClick="return overlay(this, 'smiley', 'rightbottom');return false;" />
<a href="javascript:ShowMenu('bbcode_remote.php','window2',260,350,0,0);"><img style="border: 1px solid #000000; padding-bottom: 1px;" src="img/editor/color.png" alt="colors" title="colors" class="button" onmouseover="helpline('colors');" onmouseout="helpline('default');" /></a>

notice how they all use the<input....etc. except for the one I am using for the color popup. I had to use an image as you suggested, but I originally wanted to use the <input button instead because I have classes set to them already in the stylesheet. Anyway, it works using the image with both FF and IE. FF accepts the input button as I mentioned but not IE. Well, I hope I have not confused you. big_smile

Bingiman

Re: using a URL in an input field

Oh, there's a way then:

<input class="button" type="image" onmouseover="helpline('colors');" onmouseout="helpline('default');" src="img/editor/color.png" alt="colors" title="colors" onclick="javascript:ShowMenu('bbcode_remote.php','window2',260,350,0,0);return false;" />

Re: using a URL in an input field

oh man...you're awesome. That worked great. Thank you so much. smile

Bingiman