Solved

Line up input box with gif submit button.

Posted on 2003-11-21
6
959 Views
Last Modified: 2007-12-19
Hi,

How can i get the input box and gif submit in line in this code. As it is the gif appears too high.

<FORM action=/cgi-bin/lance/search.cgi method=get>

<INPUT
      style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size=14 value="Find Find" name=keywords>

<INPUT
      type=image height=30 alt=Search width=22
      src="refferals_files/search.gif" value=Submit border=0 name=go2>
      </FORM></P>
0
Comment
Question by:macuser777
6 Comments
 
LVL 8

Accepted Solution

by:
Barry62 earned 30 total points
ID: 9800129
Try CSS:



<FORM action=/cgi-bin/lance/search.cgi method=get>

<INPUT
      style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size=14 value="Find Find" name=keywords>

<INPUT
      type=image height=30 alt=Search width=22
      src="refferals_files/search.gif" value=Submit border=0 name=go2 style="vertical-align: middle;">
      </FORM></P>
0
 

Expert Comment

by:TigerBoy
ID: 9800157
How about putting it in a table?  You can set the vertical alignment.  

<FORM action=/cgi-bin/lance/search.cgi method=get>

<table border=1 cellspacing=0 cellpadding=0>
<tr>
<td valign=middle>
<INPUT
      style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size=14 value="Find Find" name=keywords>
</td><td valign=middle>
<INPUT
      type=image height=30 alt=Search width=22
      src="test.gif" value=Submit border=0 name=go2>
      </td></tr></table></FORM>

If you have white space around your image then it may be hard to center without seeing the image.
0
 
LVL 31

Assisted Solution

by:seanpowell
seanpowell earned 20 total points
ID: 9800884
The CSS code will work - you may find it off by a pixel or 2 depending on your browser. You can also use the absmiddle attribute:

<FORM action=/cgi-bin/lance/search.cgi method=get>
<INPUT style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size="14" value="Find Find" name="keywords">
<INPUT type=image height="30" alt=Search width="22" src="refferals_files/search.gif" value="Submit" border="0" name="go2" align="absmiddle">
</FORM>
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:Zontar
ID: 9801284
Image inputs create usability and other problems. I suggest you use a standard type="submit" and apply CSS to the input to achieve the desired appearance:

<input type="submit" class="submitButton" value="Search">

.submitButton  { width:125px; height:55px; background-image:url('referrals_files/search.gif');  }
0
 
LVL 4

Author Comment

by:macuser777
ID: 9809929
Thanks all.

I used CSS as Barry62 suggested but had to use the absmiddle code to get it exact
so
30 Barry62
20 georgemarian.

0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9809997
Just glad it didn't give you a javascript error :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do i remove the outer scrollbar? 2 38
Bootstrap 3 website error 14 46
Show banners that are blocked by Ad Muncher 10 48
A form to still have contents even if some are wrong 10 47
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now