Click here to Skip to main content
15,559,927 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: working with showCreateForm() in jtable Pin
F-ES Sitecore9-Feb-16 23:58
professionalF-ES Sitecore9-Feb-16 23:58 
QuestionWhen IFrame load event is called ? Pin
Tridip Bhattacharjee4-Feb-16 2:45
professionalTridip Bhattacharjee4-Feb-16 2:45 
AnswerRe: When IFrame load event is called ? Pin
F-ES Sitecore9-Feb-16 23:26
professionalF-ES Sitecore9-Feb-16 23:26 
GeneralRe: When IFrame load event is called ? Pin
Tridip Bhattacharjee10-Feb-16 3:09
professionalTridip Bhattacharjee10-Feb-16 3:09 
GeneralRe: When IFrame load event is called ? Pin
F-ES Sitecore10-Feb-16 3:16
professionalF-ES Sitecore10-Feb-16 3:16 
GeneralRe: When IFrame load event is called ? Pin
Tridip Bhattacharjee10-Feb-16 21:44
professionalTridip Bhattacharjee10-Feb-16 21:44 
QuestionJavascript on dynamic gridview textboxs Pin
HGCoolPal2-Feb-16 3:48
HGCoolPal2-Feb-16 3:48 
AnswerRe: Javascript on dynamic gridview textboxs Pin
Keith Barrow8-Feb-16 3:16
professionalKeith Barrow8-Feb-16 3:16 
First up - it is a very good idea to rename TextBox1 to something like descriptive like TextBoxName etc. I used to teach development and it never ceased to amaze me how many students wouldn't descriptive naming because using the default is "quicker". They would, however, happily deal with mental effort required to remember TextBox14 was the Address City and were seemingly even more happy to spend time in a practical exam debugging the fact they'd mis-typed TextBox11 where they needed TextBox1.

Anyway, rant over Smile | :) . To start you off on your actual question: You can use JavaScripts getElementById()[^] to do what you want, but the problem is .net will replace the ASP.net the ID you specified with a one generated from the ID you supplied plus the IDs of its parent controls (something like Form1_GridView1_TextBoxAssessment1 I forget the exact format ). This is done to try to ensure ID uniqueness in the HTML. To compensate, you embed you JS inside ASP:
HTML
<script type="text/javascript">
    document.getElementById("<%= TextBoxAssessment1.ClientID %>")
        .onchange=function(){
            //TODO: get dest control by ID and set new value.
        };
</script>
Assuming you've re-named your textBox2 to TextBoxAssessment1. getElementById() does what it says on the tin, getting the element by its ID, onchange() detects changes to the value.The <%= TextBoxAssessment1.ClientID %> does the magic of working out the ID of your control as rendered on the browser.
KeithBarrow.net[^] - It might not be very good, but at least it is free!

QuestionNumber of day week in javascript Pin
Mazdak1-Feb-16 5:34
Mazdak1-Feb-16 5:34 
AnswerRe: Number of day week in javascript Pin
Keith Barrow1-Feb-16 5:56
professionalKeith Barrow1-Feb-16 5:56 
GeneralRe: Number of day week in javascript Pin
Mazdak1-Feb-16 6:03
Mazdak1-Feb-16 6:03 
GeneralRe: Number of day week in javascript Pin
Keith Barrow1-Feb-16 6:10
professionalKeith Barrow1-Feb-16 6:10 
GeneralRe: Number of day week in javascript Pin
Mazdak1-Feb-16 6:12
Mazdak1-Feb-16 6:12 
GeneralRe: Number of day week in javascript Pin
Mazdak1-Feb-16 6:11
Mazdak1-Feb-16 6:11 
Questioncomparing two dates in javascript Pin
Member 1026351927-Jan-16 23:40
Member 1026351927-Jan-16 23:40 
QuestionRe: comparing two dates in javascript Pin
Richard MacCutchan28-Jan-16 0:17
mveRichard MacCutchan28-Jan-16 0:17 
AnswerRe: comparing two dates in javascript Pin
Richard Deeming28-Jan-16 2:46
mveRichard Deeming28-Jan-16 2:46 
AnswerRe: comparing two dates in javascript Pin
Beginner Luck31-Jan-16 20:24
professionalBeginner Luck31-Jan-16 20:24 
QuestionConvert div into image in Java Script. Pin
varunPes23-Jan-16 3:11
professionalvarunPes23-Jan-16 3:11 
AnswerRe: Convert div into image in Java Script. Pin
Beginner Luck25-Jan-16 15:24
professionalBeginner Luck25-Jan-16 15:24 
QuestionHow to redirect the weburl to particular country when user types in Browser. Pin
pradeep yajamanam21-Jan-16 4:17
pradeep yajamanam21-Jan-16 4:17 
AnswerRe: How to redirect the weburl to particular country when user types in Browser. Pin
F-ES Sitecore21-Jan-16 4:52
professionalF-ES Sitecore21-Jan-16 4:52 
GeneralRe: How to redirect the weburl to particular country when user types in Browser. Pin
Richard Deeming21-Jan-16 4:57
mveRichard Deeming21-Jan-16 4:57 
AnswerRe: How to redirect the weburl to particular country when user types in Browser. Pin
Beginner Luck27-Jan-16 15:49
professionalBeginner Luck27-Jan-16 15:49 
GeneralRe: How to redirect the weburl to particular country when user types in Browser. Pin
Richard Deeming28-Jan-16 2:07
mveRichard Deeming28-Jan-16 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.