Solved

asp tetxbox

Posted on 2016-08-13
14
39 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 21

Expert Comment

by:masterpass
ID: 41755245
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
ID: 41755382
thank you \
\but i need to send enter keys once txt.text ="A"
0
 
LVL 21

Expert Comment

by:masterpass
ID: 41755384
$("textbox").change(function()
If(this.val() === 'A'){
   this.form.submit();
}
});
0
Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

 

Author Comment

by:pamela rizk
ID: 41755386
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
ID: 41755389
i need to call ajavascript method key press from teh code behind and passing poarameetr to it
0
 
LVL 21

Expert Comment

by:masterpass
ID: 41755390
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
ID: 41755392
You want to call js key press from the server side code? That beats all logic :)
0
 

Author Comment

by:pamela rizk
ID: 41755395
yep
0
 
LVL 21

Expert Comment

by:masterpass
ID: 41755397
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
ID: 41755423
ok thank you
teb can i call from javascript a method in aps code behind?
0
 
LVL 21

Expert Comment

by:masterpass
ID: 41755596
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
ID: 41766358
would you please dive ma an example
0
 
LVL 21

Accepted Solution

by:
masterpass earned 500 total points
ID: 41766366
0
 

Author Closing Comment

by:pamela rizk
ID: 41781162
k
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

689 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