Solved

asp tetxbox

Posted on 2016-08-13
14
29 Views
Last Modified: 2016-09-02
dear all
i have an asp textbox
 i need to assign value to this textbox and then press on enter programatically
how to do that
0
Comment
Question by:pamela rizk
  • 7
  • 7
14 Comments
 
LVL 21

Expert Comment

by:masterpass
Comment Utility
you could use jquery onchange method:

ref: http://www.w3schools.com/jquery/event_change.asp
The code could be something like:

$("textbox").change(function(){
   this.form.submit();
});

Open in new window

0
 

Author Comment

by:pamela rizk
Comment Utility
thank you \
\but i need to send enter keys once txt.text ="A"
0
 
LVL 21

Expert Comment

by:masterpass
Comment Utility
$("textbox").change(function()
If(this.val() === 'A'){
   this.form.submit();
}
});
0
 

Author Comment

by:pamela rizk
Comment Utility
but this is not working i have a atextbox inide a web user control and on a button click in asp code behing of the web user cointrol i am putting textbox1.text = "0"
and in javascript i have .keypress event ()
i need to send keys enter so taht after assigning value to teh textbxo the key press event work
0
 

Author Comment

by:pamela rizk
Comment Utility
i need to call ajavascript method key press from teh code behind and passing poarameetr to it
0
 
LVL 21

Expert Comment

by:masterpass
Comment Utility
You have to make sure to replace $("textbox") with ("#idofthetextbox") and if this.form.submit() doesn't work then replace that with ("#idofsubmitbutton").click();
0
 
LVL 21

Expert Comment

by:masterpass
Comment Utility
You want to call js key press from the server side code? That beats all logic :)
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:pamela rizk
Comment Utility
yep
0
 
LVL 21

Expert Comment

by:masterpass
Comment Utility
I would suggest that you read about what server side code is and what client side js is. If you are already processing in server side why not do all your processing in server side and then send what the browser needs to see. If by server side you mean an ajax call that is being processed in server then i should suggest that you ask the question better .
0
 

Author Comment

by:pamela rizk
Comment Utility
ok thank you
teb can i call from javascript a method in aps code behind?
0
 
LVL 21

Expert Comment

by:masterpass
Comment Utility
Yes, you can call a method in server side from js. They are known as ajax calls. If you are using jquery then read about ajax get or ajax post.
0
 

Author Comment

by:pamela rizk
Comment Utility
would you please dive ma an example
0
 
LVL 21

Accepted Solution

by:
masterpass earned 500 total points
Comment Utility
0
 

Author Closing Comment

by:pamela rizk
Comment Utility
k
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now