Click here to Skip to main content
15,919,500 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Creating a static Map Pin
Sibeesh KV29-Sep-14 2:04
professionalSibeesh KV29-Sep-14 2:04 
QuestionBad Request Call WCF Service Jquery Ajax Pin
Ericsson Alves6-Feb-14 15:32
Ericsson Alves6-Feb-14 15:32 
QuestionSolve datetime country wise to display? Pin
pkarthionline6-Feb-14 0:46
pkarthionline6-Feb-14 0:46 
AnswerRe: Solve datetime country wise to display? Pin
Garth J Lancaster6-Feb-14 0:55
professionalGarth J Lancaster6-Feb-14 0:55 
AnswerRe: Solve datetime country wise to display? Pin
Richard Deeming6-Feb-14 2:08
mveRichard Deeming6-Feb-14 2:08 
QuestionSyntax error on IE10 but working fine on IE 8... Pin
Member 102794055-Feb-14 19:57
Member 102794055-Feb-14 19:57 
AnswerRe: Syntax error on IE10 but working fine on IE 8... Pin
Richard Deeming6-Feb-14 2:05
mveRichard Deeming6-Feb-14 2:05 
QuestionPopulating Input Fields Using Button UIs Pin
ASPnoob3-Feb-14 21:14
ASPnoob3-Feb-14 21:14 
Hi all, I have a web app that has a display box and button UIs for typing numbers (0 through 9) into the display box. There is one button that when clicked generates multiple input fields.

My problem is that I can enter numbers into the first input field by clicking the numbered buttons and by typing numbers using the keyboard. Numbers can only be entered into other input fields using the keyboard. Any attempt to use the numbered buttons to enter numbers into other input fields will cause the focus to return back to the first input field.

Below are my markups and jquery
HTML
<body>
 <div id="page">
   <div id="myOutputs">


   </div>


JavaScript
<script type="text/javascript">
 $(document).ready(function () {         
         
    if ($('#box1').click())
    {      
        $(".BTN").click(function () {
            if ($.isNumeric($(this).html())){
                $("#box1").val($("#box1").val() + $(this).html());           
        }});    
             
         }
         else
             if ($('#box2').click())
             {                  
                 $(".BTN").click(function () {
                     if ($.isNumeric($(this).html())) {
                         $("#box2").val($("#box2").val() + $(this).html());
                     }
                         
                     });                 
             }
             else
                 if ($('#box3').click())
                 {
                     $(".BTN").click(function () {
                         if ($.isNumeric($(this).html())) {
                             $("#box3").val($("#box3").val() + $(this).html());    
                         }});
                 }

        $("#functs").click(function () {
         
       document.getElementById("myOutputs").innerHTML =
        "<table id='data-table'>"
       + "<tr>"
            + "<td><input type='text' id='box1'/><td></tr>"
       + "<tr>"
            + "<td><input type='text' id='box2'/><td></tr>"
       + "<tr>"
            + "<td ><input type='text' id='box3'/><td></tr>"
       + "</table>";
       document.getElementById('box1').tabIndex = "1";
       document.getElementById('box2').tabIndex = "2";
       document.getElementById('box3').tabIndex = "3";
      });
}


Please explain why the code above is giving me the problems I've stated, thanks in advance.

modified 4-Feb-14 8:09am.

AnswerRe: Populating Input Fields Using Button UIs Pin
Richard Deeming4-Feb-14 3:14
mveRichard Deeming4-Feb-14 3:14 
GeneralRe: Populating Input Fields Using Button UIs Pin
ASPnoob9-Feb-14 18:57
ASPnoob9-Feb-14 18:57 
Questionjava script project - algebric expressions Pin
chgovind2-Feb-14 0:22
chgovind2-Feb-14 0:22 
AnswerRe: java script project - algebric expressions Pin
Richard MacCutchan2-Feb-14 1:38
mveRichard MacCutchan2-Feb-14 1:38 
QuestionFailed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
Vimalsoft(Pty) Ltd30-Jan-14 8:25
professionalVimalsoft(Pty) Ltd30-Jan-14 8:25 
AnswerRe: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
Kornfeld Eliyahu Peter2-Feb-14 1:30
professionalKornfeld Eliyahu Peter2-Feb-14 1:30 
AnswerRe: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
swatishri20-Aug-20 15:19
swatishri20-Aug-20 15:19 
GeneralRe: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
Vimalsoft(Pty) Ltd20-Aug-20 23:53
professionalVimalsoft(Pty) Ltd20-Aug-20 23:53 
QuestionNo 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Vimalsoft(Pty) Ltd30-Jan-14 1:42
professionalVimalsoft(Pty) Ltd30-Jan-14 1:42 
AnswerRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Kornfeld Eliyahu Peter2-Feb-14 1:29
professionalKornfeld Eliyahu Peter2-Feb-14 1:29 
AnswerRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Doug Twyman3-Feb-14 18:28
Doug Twyman3-Feb-14 18:28 
GeneralRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Vimalsoft(Pty) Ltd3-Feb-14 19:00
professionalVimalsoft(Pty) Ltd3-Feb-14 19:00 
AnswerRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Abhishek_RK2-Mar-14 20:57
Abhishek_RK2-Mar-14 20:57 
QuestionLearning jQuery Pin
DRAYKKO27-Jan-14 7:06
professionalDRAYKKO27-Jan-14 7:06 
AnswerRe: Learning jQuery Pin
Richard Deeming27-Jan-14 7:34
mveRichard Deeming27-Jan-14 7:34 
GeneralRe: Learning jQuery Pin
DRAYKKO27-Jan-14 7:50
professionalDRAYKKO27-Jan-14 7:50 
GeneralRe: Learning jQuery Pin
Richard Deeming27-Jan-14 10:05
mveRichard Deeming27-Jan-14 10:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.