Solved

input field focus

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JQuery conflicts/syntax issue 4 23
arrays and buttons with user input 2 32
Compute age Html 2 24
Put javascript to get dropdown value 3 21
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…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

740 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