|
-
Oct 16th, 2003, 08:30 AM
#1
Thread Starter
Fanatic Member
Stupid questions
OK I have an text box and a botton on a form click the button and it does what it needs to do however i would like to allow it to also do this
User inputs some text and then presses enter and it calls a function
How the hell do u code for the enter button
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
Oct 16th, 2003, 09:16 AM
#2
Frenzied Member
Code:
<html>
<head>
<link rel="stylesheet"href="intro.css">
</head>
<script language="VB" runat=server>
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
Message.Text = "Hi " & HttpUtility.HtmlEncode(Name.Text) & ", you selected: " & Category.SelectedItem.Text
End Sub
</script>
<body>
<center>
<form action="intro6.aspx" method="post" runat="server">
<asp:adrotator AdvertisementFile="ads.xml" BorderColor="black" BorderWidth=1 runat="server"/>
<h3> Name: <asp:textbox id="Name" runat="server"/>
Category: <asp:dropdownlist id="Category" runat=server>
<asp:listitem >psychology</asp:listitem>
<asp:listitem >business</asp:listitem>
<asp:listitem >popular_comp</asp:listitem>
</asp:dropdownlist>
</h3>
<asp:button text="Lookup" OnClick="SubmitBtn_Click" runat="server"/>
<p>
<asp:label id="Message" runat="server"/>
</form>
</center>
</body>
</html>
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Oct 16th, 2003, 10:06 AM
#3
if you are using a normal vb.net form , then you can try something along these lines.......
VB Code:
[COLOR=BLUE]Private[/COLOR] [COLOR=BLUE]Sub[/COLOR] TextBox1_KeyUp([COLOR=BLUE]ByVal[/COLOR] sender [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]Object[/COLOR], [COLOR=BLUE]ByVal[/COLOR] e [COLOR=BLUE]As[/COLOR] System.Windows.Forms.KeyEventArgs) [COLOR=BLUE]Handles[/COLOR] TextBox1.KeyUp
[COLOR=BLUE]If[/COLOR] TextBox1.Text = "test" [COLOR=BLUE]Then
[/COLOR] [COLOR=BLUE]If[/COLOR] e.KeyValue = Keys.Enter [COLOR=BLUE]Then
[/COLOR] MessageBox.Show(testing("called via enter key in the textbox"))
[COLOR=BLUE]End[/COLOR] [COLOR=BLUE]If
[/COLOR] [COLOR=BLUE]End[/COLOR] [COLOR=BLUE]If
[/COLOR] [COLOR=BLUE]End[/COLOR] [COLOR=BLUE]Sub
[/COLOR] [COLOR=BLUE]Private[/COLOR] [COLOR=BLUE]Function[/COLOR] testing([COLOR=BLUE]ByVal[/COLOR] tester [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]String[/COLOR]) [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]String
[/COLOR] [COLOR=BLUE]Return[/COLOR] tester
[COLOR=BLUE]End[/COLOR] [COLOR=BLUE]Function[/COLOR]
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 16th, 2003, 10:43 AM
#4
Thread Starter
Fanatic Member
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|