473,466 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Position on input affecting focus

KeredDrahcir
426 Contributor
Can anyone help me. I have a wierd problem. I have a Search box which I need to sit on the banner. I have set the header's position to relative and then used absolute positioning to place the container box the search text input box and submit button.

When I have them positioned in place you have the click at the very top of the text box or the search button to get focus or to submit it. If I move the box up 20 pixels then the focus can goes to about where you had to click before. I means that although you can focus on it you still can't click on the whole box and I need it to be in a certian positiong and so 20 pixels doesn't work.

I'm guessing I can use JavaScript to use an onclick focus but I'd rather avoid that if I can. Could anybody have a look my code and see they have say where I'm going wrong please?

Expand|Select|Wrap|Line Numbers
  1. <div id="header">
  2.   <img class="banner" src="image path" alt="text" />
  3.   <div class="productsearch">
  4.     <form name="product_seach" action="target" method="post">
  5.       <input type="hidden" value="1" name="name" id="id" />
  6.       <input type="hidden" value="1" name="name" id="id" />
  7.       <input type="text" id="product_search_key" name="product_search_key" value=""/>
  8.       <input type="submit" name="submit_search" id="submit_search" value="Search Now"/>
  9.     </form>
  10.   </div>
  11.   <ul id="mail">
  12.     <li id="email"><a href="/contact-us.html"></a></li>
  13.   </ul>
  14. </div>
Expand|Select|Wrap|Line Numbers
  1. #header {
  2.     background-repeat: no-repeat;
  3.     background-position: 0% 0%;
  4.     margin-top: -30px;
  5.     position: relative;
  6. }
Expand|Select|Wrap|Line Numbers
  1. .productsearch{
  2.     padding: 0 10px !important;
  3.     margin: 0 !important;
  4.     border: 0 solid #ea068c;
  5.     background-color: transparent;
  6.     font: bold 10pt Arial;
  7.     line-height: 35px !important;
  8.     color: #ffffff;
  9.     width: 300px;
  10.     position: absolute;
  11.     left: 676px;
  12.     top: 39px;
  13. }    
  14. .productsearch input[type=text]{
  15.     margin: 0;
  16.     width: 240px;
  17.     border: 0 solid #d7dee4;
  18.     background-color: #d7dee4;
  19.     height: 35px;
  20. }
  21. .productsearch input[type=submit]{
  22.     width: 35px;
  23.     height: 36px;
  24.     margin: 0;
  25.     background-color: transparent;
  26.     border: 1px solid #ea068c;
  27.     text-indent: -100em;
  28.     overflow: hidden;
  29. }
  30.  
Nov 2 '12 #1
2 2263
KeredDrahcir
426 Contributor
Can anyone help me because I can't seem to get JavaScript to work on it either.
Nov 2 '12 #2
KeredDrahcir
426 Contributor
Forget it. I had the mail list set up wrongly.
Nov 2 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MarsVoyager | last post by:
Hi, I want to change the value of a submit button when the onChange event is fired by a Radio Input. Problem is, it seems the value is modified in the gui only when the Radio Input looses focus,...
6
by: MickG | last post by:
Hi, I am trying to validate these values, this seems to work fine for the phone number and name but I am trying to get the program to fail to submit and set the focus on the date when 2006 is...
2
by: ungvichian | last post by:
Okay, how do I write a page with a form so that when I click Submit, the following happens? 1. The data is submitted (of course) 2. The form is cleared (what I've tried results in the form being...
2
by: Al | last post by:
Hi, Is there any way to replace a character at a position? Without cussing the RichTextBox to scroll. For example the following code will replaces the by removing but the side effect is that it...
1
by: Adrian Parker | last post by:
v1.1 - After taking off smartnav (due to it not working properly), I've got code that will restore the scroll position of the page on postback, but now I'm looking at how to set focus on either a...
1
by: Alex Calder | last post by:
How's that for a subject line? :) OK, here's the deal. I have a web page that features a Flash movie about halfway down the page, and inside that Flash movie is content that typically...
1
by: Will_uk | last post by:
I am trying to return focus to a form input field. If i use <form>.<field>.focus() the focus returns to the field but if the field already contains a value it selects it (blacks it out). Is it...
2
by: FormLess | last post by:
I'm using JS to dynamically change the CSS attrib's of User Input Fields in a form. It works fine for text input fields but does not seem to work at all for TEXTAREAS. (IE6) Is there a tweak...
4
by: Andrew Poulos | last post by:
I have a form that looks something like the following: <form"> <div id="pg0"> <!-- more HTML here --> <input type="text" name="f0_0" > </div> <div id="pg1" style="display:none;"> <!-- more...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.