Home Search Member List Faq Register Login  
JavaScript Tips
check box text change on checked/select change

Thread Starter: rabid lemming   Started: 09-19-2007 3:23 AM   Replies: 0
 Karamasoft Support Forums » General Discussions » JavaScript Tips » check box text change on checked/select change
 Printable Version    « Previous Thread   Next Thread »
  19 Sep 2007, 3:23 AM
rabid lemming is not online. Last active: 5/19/2008 9:27:46 AM rabid lemming

Not Ranked
Joined on 09-19-2007
Posts 1
check box text change on checked/select change

Don’t know why I’m posting this here but thought you may want to include this in any future white paper JavaScript tips new letters [*-)]


The other day I was trying to simply change the check box text when it was clicked/when the selected state changed, with out triggering the page post back event. However, I found it next to impossible so I came up with a nifty way to fix the problem

place this any where on your web page ideally in the head:



<script type="text/javascript">

function change(checked){

if (checked == true) {

ChangeTxt.innerHTML = 'The current task will be applied to the specified retailer';

}else{

ChangeTxt.innerHTML = 'The current task will be applied to all retailers';

}

}

</script>


 



Then for the check box


 

<div><input type="checkbox" id="mycheckbox" name="AddReailerChBx" onclick=change(this.checked);" runat="server" /><a id="ChangeTxt" name="ChangeTxt" runat="server" >Defualt message</a></div>
 



Should work for most browsers Wink
I hope this helps some one some day having the same problem


  
 Page 1 of 1 (1 items)
Karamasoft Support Forums » General Discussions » JavaScript Tips » check box text change on checked/select change

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.