Retrieve the assigned value of a textbox using a JavaScript function

I'm currently using the script below:

<script type="text/javascript">
     $(document).ready(function () {

         $("#<%=txtEnd.ClientID %>").dynDateTime({
             showsTime: true,
             ifFormat: "%Y/%m/%d %H:%M",
             daFormat: "%l;%M %p, %e %m, %Y",
             align: "BR",
             electric: false,
             singleClick: false,
             displayArea: ".siblings('.dtcDisplayArea')",
             button: ".next()"
         });
</script>

Even though I can access txtEnd.Text, it's empty. How can I retrieve the value that is inserted into the box?

Code behind

DateTime start = Convert.ToDateTime(txtStart.Text);

Answer №1

Finally understood the solution.

DateTime initialTime = Convert.ToDateTime(Request.Form[txtStart.UniqueID]);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using Handlebars to incorporate altered ajax information into a template

Currently, I am exploring ways to utilize manipulated data from an ajax request in conjunction with Handlebars. Within my database, the data is stored as an object like so: {"1 year":"$4.95", "2 years":"$3.95"} My objective now is to make use of this d ...

Breaking down the initial state within a redux reducer

Can you explain the distinction between returning state in the default case of a Redux reducer using return state and return { ...state } ? ...

Enhancing data interpretation using jquery for json data

Is there a way to enhance this? I would like to streamline it, possibly using a loop because in the future I may need to display more than just 10 questions. I attempted to utilize variables with strings instead of "idX" but encountered issues. I prefer to ...

Transitioning from ASP.NET Webforms to ASP.NET Core Razor pages

I am in the process of transitioning a handful of ASP.NET Webforms to ASP.NET Core Razor pages. Here is an example of how one of these pages currently functions. However, I am unsure where to start with converting it to Razor pages. I am open to alternati ...

Issue with ngTable: Error retrieving data for server-side pagination

I am currently working on setting up a server-side table using ng-table. However, I am encountering some issues with the getData function. It keeps giving me errors such as $defer.resolve is not a function or params is not defined. I noticed that I can ac ...

Steps for registering Ajax Control Toolkit in Global Assembly Cache (GAC)

Could somebody please share the steps to install the ajax control toolkit in GAC using visual studio 2008? Your help would be greatly appreciated. Thank you. ...

What is the best way to use javascript to input data onto a form?

I am looking for a way to retrieve data from my MySql database and display it on an HTTP form. Specifically, when I type in a text field, I want the name of the person to appear. <html> <head> <script type="text/javascript"> func ...

How can you initiate the wizard sequence again in TelegrafJS?

I've created a handler function for "/start" that leads to the wizard scene. Now, I have a message with an inline_keyboard containing a button labeled "redo". When I click on the "redo" button, I want it to restart the entire scene, basically initiat ...

React Router Link Component Causing Page Malfunction

Recently, I delved into a personal project where I explored React and various packages. As I encountered an issue with the Link component in React Router, I tried to find solutions online without any luck. Let me clarify that I followed all installation st ...

Having trouble accessing a website that is embedded within an iframe, and experiencing issues with several ajax post requests not functioning properly within the iframe specifically on Chrome

I am currently dealing with a situation where I have two distinct websites, (constructed with PHP) and (also a PHP site). To integrate them, I have embedded site1 inside site2 using an iframe. <iframe src="https://site1.com" seamless width= ...

JavaScript function encountered an error due to an expected object

Currently, I am in the process of developing an application using VS2015, JavaScript, Angular, and MVC 5. Here is an excerpt of my JavaScript code: var myApp = angular.module('QuizApp', []); myApp.controller('QuizController', [&apos ...

Ways to identify the current configuration of ckeditor in use

I've created a custom CKEditor plugin with a unique dialog box setup. To include the dialog, I use the following code: var customize_dialog = this.path + 'dialogs/customdialog.js' ; CKEDITOR.dialog.add( myPluginName, customize_dialo ...

In what situations might a finally block fail to execute?

Are there any circumstances where the code in a finally block may not be reached, aside from the usual suspects like process exit(), termination signal, or hardware failures? In this TypeScript code snippet that usually runs smoothly in node.js, occasiona ...

Sending information from a webpage to an application in Express

Seeking guidance on a problem where I'm trying to send a string to the server from a jade view. The value is returning on the frontend, but when attempting to store it in an object, I get [object Object]. I suspect the issue lies around the parameter ...

Tips for preventing directly mutating a prop within a recursive component

The child operates on its own copy of the prop data and can notify the parent using `$emit` when a change occurs. Imagine dealing with a recursive tree structure, like a file system for example: [ { type: 'dir', name: 'music', childr ...

Utilizing the native cursor feature in Adobe AIR JavaScript using MouseCursorData

I have been exploring the content of this article: which details how to create a native cursor in AIR without resorting to using a sprite to mimic the functionality. However, my project is based on HTML/JavaScript rather than ActionScript. Here is the c ...

Expanding the width of Material UI Javascript Dialog Box

Currently, I am utilizing the dialog feature from Material UI in my React JS project and I am looking to expand its width. After some research, I discovered that there is a property called maxWidth which allows you to adjust the width of the dialog. Howe ...

Performing asynchronous ajax calls with jQuery

Here is some code I have that involves a list and making an ajax call for each element in the list: util.testMethod = function(list) { var map = new Map(); list.forEach(function(data) { $.ajax({ ...

Access to web API from a different domain using $http AngularJS request was blocked due to a denied cross-domain localhost

Using AngularJS hosted on an ASP.NET server. Making a call to a web API. When making a POST request to the web API without parameters, it works. However, when passing parameters to the POST request, it returns the following error: Error: XMLHttpRequest can ...

Ensure that the Bootstrap form validation checks for both an empty field and a valid URL

I'm currently working on validating a form field in Bootstrap 4.4. The goal is to not only check if the field is filled out, but also to ensure that it contains a valid URL. This URL can be an internal link, a hostname, or an IP address. However, it m ...