Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8610935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:14:47+00:00 2026-06-12T04:14:47+00:00

I have this view: <script type=text/javascript src='<%: Url.Content(~/Scripts/new.js) %>’></script> <div class=col1> Number of Questions:

  • 0

I have this view:

<script type="text/javascript" src='<%: Url.Content("~/Scripts/new.js") %>'></script>
<div class="col1">
  Number of Questions:
</div>
<div class="col2-input" id="no-of-questions-value">
  <input type="hidden" name="NumberOfQuestionsHidden" id="NumberOfQuestionsHidden" value="<%: Model.NumberOfQuestions %>" />
  <%: Html.TextBoxFor(model => model.NumberOfQuestions) %>
</div>
<div class="col3">
  <div id="save-no-of-questions-button">
    <a href="javascript:saveNoOfQuestions();" class="button">Save</a>
  </div>
</div>

and the new.js where I determine the values: this js runs a scorm module and logs each event as I go through the questions in the scorm module, I count all correct and all incorrect then I know how many questions were asked.

 function LogEvent(action,data)
 {
    if (data == "correct") {
       correct_count++;
       alert("incorrect count = " + incorrect_count + " correct count = " + correct_count);
 }

 if (data == "incorrect") {
    incorrect_count++;
    alert("incorrect count = " + incorrect_count + " correct count = " + correct_count);
 }

}

to get the total number of questions i add correct_count and incorrect_count and want to pass this to the view into Html.TextBoxFor(model => model.NumberOfQuestions).
I dont know how to go about this. any help please?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:14:48+00:00Added an answer on June 12, 2026 at 4:14 am

    I wonder why you present the number of questions in a textbox, but still.. You can update your textbox value by:

    document.getElementById('NumberOfQuestions').value = 'whatever you want';
    

    This will work, since the default element ID is name of the model property.

    To get the client ID clean way, you can read more here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Javascript: <script language=javascript type=text/javascript> $().ready(function() { $('#ex2').jqm({ajax: 'view.php?id=<?=$objResult[id];?>', trigger: 'a.ex2trigger'}); });
I have the following javascript in a View: <script type=text/javascript> var pusher = new
i have the following javascript in my view: $.ajax({ url:<?php echo site_url('switches/showknownvlans/'.$ip.'/'.$hardwaremodel);?>, type:'POST', dataType:'json',
I have this view @model IEnumerable<ViewModelRound2> ... <snip> ... @{ using (Html.BeginForm(new { round1Ring3Bids
I have this view (DetailsContainer, first class in code section of this question) with
I have this Haml view: !!! strict %html{:xmlns => http://www.w3.org/1999/xhtml} %head %meta{:content => text/html;
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
How can i dynamically load a Partial View? I mean I have this view,
I have this in my partial view: <tr> <% for (int currentDay = 0;
I have this code in my view: echo form_label('State', 'state'); $options = array( 'No

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.