textbox

textbox validation accepting Ports in javascript

南楼画角 提交于 2019-12-24 09:49:53
问题 the question was accepting one or many ports that has one space between them with help of friends, I used this one for my answer but for example if I enter 88888 it will alert me such this thing: 88888NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN is not correct how can I correct this <script type="text/javascript"> function portvalidating(field) { var output=''; m=field.value; if(/^\d{1,5}([ ]\d{1,5})*$/.test(m)) { var parts = m.split(' '); for(i in parts) { var p= parseInt(parts[i]); if(!((0 <= p) &&

How to prevent user from deleting text in a text box

泪湿孤枕 提交于 2019-12-24 09:43:53
问题 Ok so I am new here and was wondering if someone a little more advance then me can help me out. I have text box on my website with code for user(s) to copy the code that's in the text box and paste the code in Orkut scrapbook which will generate a imagine. I am using onclick so when user clicks on code it highlight it and then they can copy. The problems is that you can delete or remove text from within box, if your not careful. I DONT want the user to be able to delete code in text box. How

ASP.NET TextBox OnTextChanged event not fire

戏子无情 提交于 2019-12-24 08:46:22
问题 I've the following problem: asp.net TextBox server side control, fire onTextChanged only when it loose focus. I would like to fire my server side event each time user press a key. How can i do ? Thanks 回答1: <asp:TextBox runat="server" onkeyPress="MyKeyPressEvent;" ID="txtUserName" /> Just add the onkeyPress client event to your textbox. Then in your JavaScript function "MyKeyPressEvent", call a PageMethod that fires your event method. Pagemethods are good with onkeyPress, since they have very

Dynamically added TextBoxes empty on button click

夙愿已清 提交于 2019-12-24 07:48:31
问题 I'm adding TextBoxes dynamically and when I click a submit button and have a postback, I can't see the values entered into the TextBoxes, all are coming up emtpy. Here's the .aspx page...\ form id="form1" runat="server"> <asp:PlaceHolder ID="phFormContent" runat="server"> </asp:PlaceHolder> <br /><br /> <asp:Button ID="btnAddForm" runat="server" Text="Add Form" OnClick="btnAddForm_Click" /> <asp:Button ID="btnSubmitForms" runat="server" Text="Submit Forms" OnClick="btnSubmit_Click" /> </form>

keep formatting entered in asp.net textbox (carriage return, new line, etc)

荒凉一梦 提交于 2019-12-24 07:14:51
问题 I have a textbox using multiline mode and when I create the stored procedure parameter for updating I use Server.HtmlEncode on the textbox value. I can copy the content from the data record into Notepad and it shows the spaces where the user has pressed the Enter key for new paragraphs. When displaying that content on a page (not a textbox for editing; just assigning the content to a Literal control), it has all the text run together. I have done some searches about using Replace and

keep formatting entered in asp.net textbox (carriage return, new line, etc)

谁说我不能喝 提交于 2019-12-24 07:14:02
问题 I have a textbox using multiline mode and when I create the stored procedure parameter for updating I use Server.HtmlEncode on the textbox value. I can copy the content from the data record into Notepad and it shows the spaces where the user has pressed the Enter key for new paragraphs. When displaying that content on a page (not a textbox for editing; just assigning the content to a Literal control), it has all the text run together. I have done some searches about using Replace and

TextBox ScrollToHorizontalOffset will not scroll after text is long enough

自作多情 提交于 2019-12-24 06:51:48
问题 I have a textbox (textBox1 as an example) to which i'm periodically appending a character (every second or so). I wish to make it so that when the text gets too long to fit in the textbox the overflow will actually go towards the left of the textbox even when it's not focused instead of the normal behaviour which is to the right, this way the last character will always be shown. The way I've done it is when I'm adding the character i'm also doing: textBox1.ScrollToHorizontalOffset(textBox1

TextBox not editing after SelectAll in vb.net

99封情书 提交于 2019-12-24 06:44:29
问题 I have an issue, The thing is I have to allow user to enter numeric value in text box up to one decimal point, When all text selected and I try try to edit text by entering any numeric key, It wont let it change. Here is the text box with value. The code behind, Keypress Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Regex.IsMatch(TextBox1.Text, "\.\d") Then e.Handled = True End If End Sub Kindly

WPF doesn't honor Textbox.MinLines for Auto height calculation

穿精又带淫゛_ 提交于 2019-12-24 05:06:21
问题 I want to have a TextBox which Height grows as Iam entering lines of Text. I've set the Height property to "Auto", and so far the growing works. Now I want that the TextBox's Height should be at least 5 lines. Now I've set the MinLines property to "5" but if I start the app the TextBox's height is still one line. 回答1: Try setting the MinHeight property. 回答2: A hack to make the MinLines property work public class TextBoxAdv : TextBox { bool loaded = false; /// <summary> /// Constructor /// <

WPF doesn't honor Textbox.MinLines for Auto height calculation

一曲冷凌霜 提交于 2019-12-24 05:05:10
问题 I want to have a TextBox which Height grows as Iam entering lines of Text. I've set the Height property to "Auto", and so far the growing works. Now I want that the TextBox's Height should be at least 5 lines. Now I've set the MinLines property to "5" but if I start the app the TextBox's height is still one line. 回答1: Try setting the MinHeight property. 回答2: A hack to make the MinLines property work public class TextBoxAdv : TextBox { bool loaded = false; /// <summary> /// Constructor /// <