Solved

make link side by side with text field

Posted on 2013-11-12
6
299 Views
Last Modified: 2013-11-14
hi everyone, i have a webpage consisting of form elements

next to each text box i have the following link:
 <A HREF="javascript:stringSelect_1_1_27_1()">
        <IMG SRC="/img/attrtable/stringselect.gif"
        ALT="Select Department"
        TITLE="Select Department"
        BORDER="0">
        </A>

Open in new window


this link is appearing underneath the text box.  i would like the link to the right of the text box.  how do i achieve this?
readme.png
default.css
example.html
0
Comment
Question by:AxISQS
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 500 total points
ID: 39643255
If you really want to ensure that they display correctly then I would set them in containing div's like so:

Current code:

<DIV class=fb-input-box><INPUT id=_1_1_27_1 onfocus=this.blur() 
value="[LL_FormTag_1_1_27_1 /]" maxLength=254 type=text name=_1_1_27_1 
autocomplete="off" data-hint="" placeholder=""> <A 
href="javascript:stringSelect_1_1_27_1()"><IMG title="Select Department" 
border=0 alt="Select Department" src=""> </A></DIV>

Open in new window


Modify it to:

<DIV class=fb-input-box style="width: 300px;"><DIV style="width: 200px; float: left;"><INPUT id=_1_1_27_1 onfocus=this.blur() 
value="[LL_FormTag_1_1_27_1 /]" maxLength=254 type=text name=_1_1_27_1 
autocomplete="off" data-hint="" placeholder=""></DIV><DIV style="width: 100px; float: left;"> <A 
href="javascript:stringSelect_1_1_27_1()"><IMG title="Select Department" 
border=0 alt="Select Department" src=""> </A></DIV></DIV><br style="clear: left;" />

Open in new window


(I put the CSS inline so you could see the styles that went with each element, however you are welcome to transfer them to your CSS file if you like.  Just assign the elements the corresponding classes or id's you would need to do this.)
0
 
LVL 58

Expert Comment

by:Gary
ID: 39643349
Set the anchor tag css to have a width:1% and display: inline-block;
0
 

Author Comment

by:AxISQS
ID: 39643400
in the text field below, what div needs those properties?  thanks

     
<div style="PADDING-BOTTOM: 10px" id="item5" class="fb-item fb-75-item-column">
        <div class="fb-grouplabel">
          <label style="DISPLAY: inline" id="item5_label_0">Division</label>
        </div>
        <div class="fb-input-box">
          <input id="_1_1_2_1" name="_1_1_2_1" maxlength="254" placeholder="" data-hint=""
          autocomplete="off" type="text" VALUE="[LL_FormTag_1_1_2_1 /]" ONFOCUS="this.blur()"/>
          <A HREF="javascript:stringSelect_1_1_2_1()">
          <IMG SRC="/img/attrtable/stringselect.gif"
          ALT="Select Division"
          TITLE="Select Division"
          BORDER="0">
          </A>
        </div>
      </div>   

Open in new window

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 39643603
To be honest with you, and not desiring to contradict our esteemed expert GaryC123, I cannot be so bold as to declare that setting that div to 1% will resolve your issue.  We do not have the image dimensions of the images you are using, and if those dimensions exceed 1% of the width, you will not obtain the results you desire.  Whereas with my solution, you can adjust the widths of the two containing divs (the ones with style="width: 200px;" and style="width: 100px;" respectively) to widths that will work for you.  Simply change the 200px and 100px to the dimensions you truly need.

One question, it appears (from how messed up the code looks) that you are using a web design program like FrontPage.  Is this the case?  Perhaps you are not too comfortable working directly in HTML and CSS?
0
 

Author Comment

by:AxISQS
ID: 39644752
I tried the first suggestion by OmniUnlimited but it didn't work.  It shrunk the text box and the down arrow (link) was still underneath the text box and not to the right.

The text box should be 360px wide.  The arrow is 25px wide.

I adjusted the values but couldn't get it to look right.  Here is the entire code where I made the adjustment.  Please see the css in the first post as needed.  Thanks for your time.

         <div class="fb-grouplabel">
          <label style="DISPLAY: inline" id="item4_label_0">Department</label>
        </div>
        <div class="fb-input-box" style="width: 360px;"><DIV style="width: 25px; float: left;">
          <input id="_1_1_27_1" name="_1_1_27_1" VALUE="[LL_FormTag_1_1_27_1 /]" maxlength="254" placeholder="" data-hint="" autocomplete="off" type="text" ONFOCUS="this.blur()" />
          <A HREF="javascript:stringSelect_1_1_27_1()">
		      <IMG SRC="/img/attrtable/stringselect.gif" ALT="Select Department" TITLE="Select Department" BORDER="0"> </A>
        </div>
        </div>
        <br style="clear: left;" />    

Open in new window

0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 39645027
I'm sorry, but that was not the code I gave you.  You are missing the div wrapper around the anchor tag (the <A HREF="javascript:stringSelect_1_1_27_1()"><IMG SRC="/img/attrtable/stringselect.gif" ALT="Select Department" TITLE="Select Department" BORDER="0"> </A>) and you set the input field containing div to only 25px.

Please look at my code very carefully, and copy ALL of it EXACTLY into your code.  Otherwise, of course it will not work.
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
Javascript create file issue 4 48
Error in JQuery 5 39
Redirect Website for Mobile Devises 7 38
Bootstrap on PLNKR 3 14
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

895 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

13 Experts available now in Live!

Get 1:1 Help Now