textbox

how to get the value from a textbox that is next to my text

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-25 00:05:21
问题 i have an html page where i have a table of items (one item per row) where each item is a html link that says "Add" and there is a textbox next to each link with a number in it. the text link and the textbox are in the same td inside the row of the table. how do i, using jquery, capture the value from the textbox that is to the right of the link i click on. 回答1: You could give your link a class, then do this: $("a.myClass").click(function() { alert($(this).next().val()); }); If you have a lot

WPF Masked Textbox with a value that does not contain mask

倾然丶 夕夏残阳落幕 提交于 2020-01-24 20:20:16
问题 I need a WPF Textbox that displays a phone number as "(555) 555-5555" but has a value of "5555555555". All of the examples I'm seeing have the ability to mask the control on the UI but that affects the bound property of my view model so that the property value has the extraneous ()- characters. 回答1: How about an IValueConverter? 回答2: I am thinking that you will probably have to roll-your-own. It shouldn't be too difficult, subclass and override to obtain the results you are looking for. 来源:

How to retrieve a changed value of databound textbox within datagrid

非 Y 不嫁゛ 提交于 2020-01-24 15:12:12
问题 ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value to a variable which is then used to update the database. The DataGrid is rebound with the new values. The issue I'm having is that when assigning the .Text value to the

C#/.NET: TextBox is not 'focused' after a process was initiated

倖福魔咒の 提交于 2020-01-24 00:44:30
问题 I am having a problem after opening the notepad once I click the button "btnSearch". The idea is that once I clicked the button 'btnSearch', the textbox 'txtSearch' should be 'focused' even after a process was initiated/opened outside the main window. Here's my code: private void btnSearch_Click(object sender, RoutedEventArgs e) { System.Diagnostics.Process.Start("notepad"); txtSearch.Focus(); // not working } Any suggestions? 回答1: The below is the code you would need. This could be done

Highlight special word in a TextBox

限于喜欢 提交于 2020-01-23 23:11:00
问题 How do I highlight all occurrences of a list of words in a text. For example, i do have a list of strings ("if", "else", "then", "while", "true"). I do need to find them in a TextBox and highlight them (foreground + background color). Examples as how it should look: The current approach is to override TextBox and do "something" in the OnTextChange event. 回答1: see this question: How to highlight portion of a Rich TextBox WPF control if there are more than 2 spaces? and this open source control

Highlight special word in a TextBox

时光怂恿深爱的人放手 提交于 2020-01-23 23:10:12
问题 How do I highlight all occurrences of a list of words in a text. For example, i do have a list of strings ("if", "else", "then", "while", "true"). I do need to find them in a TextBox and highlight them (foreground + background color). Examples as how it should look: The current approach is to override TextBox and do "something" in the OnTextChange event. 回答1: see this question: How to highlight portion of a Rich TextBox WPF control if there are more than 2 spaces? and this open source control

How to get textbox value in node.js file?

纵饮孤独 提交于 2020-01-23 21:29:06
问题 This is my html code: <form id="fileupload" method="POST" enctype="multipart/form-data"> <div class="row fileupload-buttonbar"> <textarea name="txtFolderName" rows="1"></textarea> <button type="create" class="btn btn-primary start"> <i class="glyphicon glyphicon-upload"></i> <span>Create Folder</span> </button> </div> When I click the "Create Folder" button, I will do some function based on the textbox value. How to get the textbox value to the node.js file during POST method? 回答1: For

C# textbox show previous written texts

ⅰ亾dé卋堺 提交于 2020-01-21 19:36:07
问题 For example if you go to facebook and press double click on the login textbox, then there are some Logins that previous someone wrote. Is there any way to make this dropdown of previous inputs on C# textbox? I don't want combobox. 回答1: See the TextBox.AutoCompleteMode and TextBox.AutoCompleteSource properties of the TextBox. You need to do something on the following lines: namespace WindowsApplication1 { public partial class Form1 : Form { AutoCompleteStringCollection autoComplete = new

C# textbox show previous written texts

匆匆过客 提交于 2020-01-21 19:35:09
问题 For example if you go to facebook and press double click on the login textbox, then there are some Logins that previous someone wrote. Is there any way to make this dropdown of previous inputs on C# textbox? I don't want combobox. 回答1: See the TextBox.AutoCompleteMode and TextBox.AutoCompleteSource properties of the TextBox. You need to do something on the following lines: namespace WindowsApplication1 { public partial class Form1 : Form { AutoCompleteStringCollection autoComplete = new

How to set and get updatesourcetrigger of a textbox in codebehind?

馋奶兔 提交于 2020-01-21 08:53:27
问题 Just a short question : In wpf, how do I set and get updatesourcetrigger of a textbox in codebehind ? Thanks Update : I follow AngleWPF's code : var bndExp = BindingOperations.GetBindingExpression(this, TextBox.TextProperty); var myBinding = bndExp.ParentBinding; var updateSourceTrigger = myBinding.UpdateSourceTrigger; But I got the exception : An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in PresentationFramework.dll Additional information: Exception