Solved

input field focus

Posted on 2013-01-10
5
217 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
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…

789 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