JavaScript event.target is not working on mobile event.target not working,event.target not working in firefox,

I am using a form to collect data. Once the user hits submit, it is suppose to update the user and question documents. The function works on desktop but not on mobile.

When I hard code the values answer and wager it works on both. The issue seems to be event.target.wager.value. I tried putting the values in a Session and I tried converting them to int and strings.

Code below is on Main.js

Template.questionCard.events({
    'submit form': function(event) {
        event.preventDefault();
        var questionId = this._id;
        var currentUser = Meteor.userId();

        // Collects the data from the form when submitted.
        // var answer = event.target.play.value;
        // var wager = event.target.wager.value;

    var answer = "Run";
    var wager = 5000;

    //Add user data to question
    Meteor.call('questionAnswered', currentUser, questionId, answer, wager);

    console.log('User: ' + currentUser + ' answered question ' + questionId + ' -- ' + answer + ' ' + wager);
}

Below is the questionAnswered method called.

'questionAnswered' : function( user, questionId, answer, wager){
    QuestionList.update(questionId, {$push: {usersAnswered: user}});
    console.log(user + " answered " + questionId)
    console.log("User wagered " + wager + " coins." );
    Meteor.users.update( {_id: user}, {$inc: { "profile.coins": -wager}} );


    //Add question, wager and answer to the user's account.
    Meteor.users.update( { _id: user}, {$push: {questionAnswered: { questionId: questionId, 
        wager: wager, answered: answer}}});
    console.log(user + " answered " + answer);

    //Update the question with the users answer and wager.
    if (answer == "Run"){
        QuestionList.update(questionId, {$push: { usersRun: {userID: user, amount: wager } }});
    } else if (answer == "Pass"){
        QuestionList.update(questionId, {$push: {usersPass: {userID: user, amount: wager}}});
    } else if (answer == "Fumble"){
        QuestionList.update(questionId, {$push: {usersFumble: {userID: user, amount: wager}}});
    } else if (answer == "Interception"){
        QuestionList.update(questionId, {$push: {usersInterception: {userID: user, amount: wager}}});
    }
Answer:1

Found a comment by Jimmy Mian-Guan Lim here. Using the radio input and the name of the group to find the checked option. Then returning the value.

    var answer = template.find('input:radio[name=play]:checked').value;
    var wager = template.find('input:radio[name=wager]:checked').value;
Answer:2

I'm not sure why this .show() method not working within the .click() function? The alert is displayed correctly, but the page overlay is not. html <!-- page overlay for login --> <span id="...

I'm not sure why this .show() method not working within the .click() function? The alert is displayed correctly, but the page overlay is not. html <!-- page overlay for login --> <span id="...

  1. jquery show not working
  2. jquery show not working after hide
  3. jquery show not working visibility hidden
  4. jquery show not working in chrome
  5. jquery show not working before ajax call
  6. jquery show not working in ie11
  7. jquery show not working in firefox
  8. jquery show not working safari
  9. jquery show not working on div
  10. jquery show not working on hidden
  11. jquery show not working in ie
  12. jquery show not working iframe
  13. jquery show hide not working
  14. jquery show hide not working in chrome
  15. jquery show slow not working
  16. jquery show method not working
  17. jquery show function not working
  18. jquery show animation not working
  19. jquery show modal not working
  20. jquery show duration not working

As part of a test scenario, I would like to use some large JSON objects. I would like to store these in a separate directory, and then import each object as I need them. Currently I am using the ...

As part of a test scenario, I would like to use some large JSON objects. I would like to store these in a separate directory, and then import each object as I need them. Currently I am using the ...

  1. node in json
  2. node json from file
  3. node json from string
  4. node json from buffer
  5. node json from object
  6. node js use json file
  7. node js use json

Is it possible to declare an anonymous generator function using the arrow syntax in ES6 JavaScript? This is what I've tried: let func = *() => { }; but this doesn't parse (I'm using Babel.js to ...

Is it possible to declare an anonymous generator function using the arrow syntax in ES6 JavaScript? This is what I've tried: let func = *() => { }; but this doesn't parse (I'm using Babel.js to ...

Title - Sorry about the title, it was difficult for me to actually explain this. So I recently finished working on a dynamic fields system using jQuery. This is all working great however I'm wanting ...

Title - Sorry about the title, it was difficult for me to actually explain this. So I recently finished working on a dynamic fields system using jQuery. This is all working great however I'm wanting ...