Solved

input field focus

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

776 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