Solved

input field focus

Posted on 2013-01-10
5
208 Views
Last Modified: 2013-01-23
I have the app upon clicking the button I am selecting fields add put then on the main form. That part works however when the fields are displayed the focus is only on the first drop down what makes it difficult to select a value from the second drop down. I think something has to do with focus
0
Comment
Question by:erikTsomik
5 Comments
 
LVL 12

Expert Comment

by:jessegivy
ID: 38764254
A little more info about what you want to accomplish?

You're aware that only one element on a page can have focus?

There is a JavaScript function where you can set the focus of an element, it's called focus(). Example: document.getElementById("elementID").focus(), where "elementID" is the id of the field you want to have focus.

Cheers,

JI
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 38764261
right but Once i select something  and i need to go a diff drop down it does not let me make a selection because because of the focus of the first element
0
 
LVL 30

Expert Comment

by:LZ1
ID: 38764282
Can you post a live link?
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 38764301
there is no link because I working locally. but the code is below . or may be because it is inside of the table

<table style="border:0px solid none;margin:10px;" id="270">
                                                            
                                                                  <tbody><tr id="p_16">
                                                                        <td width="4%"><img width="16" height="17" onclick="DeleteBody(16,4,270);return false;" title="Delete This Record" alt="Delete This Record" src="/includes/images/icon_delete.gif" class="delete" id="i_16"></td>
                                                                        <td width="50%"><b> tr. test</b></td>
                                                                  </tr>
                                                                  <tr id="pd_16">
                                                                        <td colspan="2">
                                                                              <div style="margin:20px;" id="test4_16">

      

      
                                          <br>
                                          <label>

                                                 <span><b> Employee of the year</b></span>
                                                 
                                                       <select  id="RD16_3" name="RD16_3">
                                                            <option value="">Please choose an option here</option>
                                                            
                                                                        <option value="1">1</option>
                                                                  
                                                                        <option value="2">2</option>
                                                                  
                                                                        <option value="3">3</option>
                                                                  
                                                      </select>
                                                      
                                                      <br>
                                          </label>
                                    
                  <label>
                        <span><b>Cell Carrier</b></span>
                        
                              <select class="validate[]" id="RD16_5" name="RD16_5">
                                    <option value="">Please choose an option here</option>
                                    
                                          <option value="1">3 River Wireless</option>
                                    
                                          <option value="2">ACS Wireless</option>
                                    
                                          <option value="3">Alltel</option>
                                    
                                          <option value="4">AT&amp;T</option>
                                    
                                          
                                    
                                          
                                    
                              </select>
                        
                  </label>
            </div>
                                                                              
                                                                        </td>
                                                                  </tr>
                                                            
                                                      </tbody></table>
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 38764453
I don't see anything that changes focus.  Just add an onchange event to the first select:

<select  id="RD16_3" name="RD16_3" onchange="document.getElementById('RD16_5').focus();">

Cd&
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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 learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 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

24 Experts available now in Live!

Get 1:1 Help Now