By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

Java script problem while using Asp:Wizard Control

P: 13
I've got two cute editor controls each in a different WIZARD step. My javascript seems to be working from the first step and javascript events firing but when I go to the second step (containing a second editor) and then go back to the first step I find that the OnInitialized and OnChange events are no longer firing for the first editor.

I had assumed that these events would always fire for any cute editors on a page?

Thx in advance
Oct 30 '07 #1
Share this Question
Share on Google+
9 Replies


10K+
P: 13,264
I've got two cute editor controls each in a different WIZARD step. My javascript seems to be working from the first step and javascript events firing but when I go to the second step (containing a second editor) and then go back to the first step I find that the OnInitialized and OnChange events are no longer firing for the first editor.

I had assumed that these events would always fire for any cute editors on a page?

Thx in advance

Java != Javascript
Moved to Javascript forum.
Oct 30 '07 #2

acoder
Expert Mod 15k+
P: 16,027
Can you post some code that we can look at?
Oct 30 '07 #3

P: 12
I'm having the same problem. Here's some code... the OnChanged event fires only when viewing Editor1 for the first time only... doesn't fire for Editor2 at all...

[HTML]<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %>

<%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form runat="server">
<asp:Wizard ID="Wizard1" runat="server">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
<CE:Editor ID="Editor1" runat="server">
</CE:Editor>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
<CE:Editor ID="Editor2" runat="server">
</CE:Editor>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
</form>
</body>
<script type="text/javascript" language="javascript">
[/HTML]
Expand|Select|Wrap|Line Numbers
  1. var editor1 = document.getElementById('<%= Editor1.ClientID%>');
  2. var oldColour = editor1.style.borderColor;
  3.  
  4. function CuteEditor_OnChange(editor)
  5. var editdoc = editor.GetDocument();
  6. alert(editdoc.body.scrollWidth>800)
  7. if(editdoc.body.scrollWidth>800)
  8. {
  9. editor1.style.borderWidth=3;
  10. editor1.style.borderColor="#FF0000";
  11. }
  12. else
  13. {
  14. editor1.style.borderColor=oldColour;
  15. }
  16. }
  17. </script>
  18. </html>
Nov 7 '07 #4

acoder
Expert Mod 15k+
P: 16,027
You're not referring to Editor2 in your code. You've used the global variable editor1 within the function.
Nov 7 '07 #5

P: 12
To simplify my code... see below. OnInitialized and OnChanged events fire only on the first initialization and viewing of Editor1. They never fire for Editor2 or for subsequent changes on Editor1 after having gone to wizardstep2.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">
  2.  
  3. function CuteEditor_OnChange(editor)
  4. alert("OnChange")
  5. }
  6.  
  7. function CuteEditor_OnInitialized(editor)
  8. {
  9. alert("OnInitialized")
  10. }
  11. </script>
Nov 7 '07 #6

acoder
Expert Mod 15k+
P: 16,027
Can you show the client-side code (how it turns out in the browser) for Editor2?
Nov 7 '07 #7

P: 12
They're quite long... too long that it's not letting me post it... let me think of another way to put it up
Nov 7 '07 #8

P: 12
view source on each of these...

Wizard Step 1

Wizard Step 2
Nov 7 '07 #9

acoder
Expert Mod 15k+
P: 16,027
The second link doesn't work.

I noticed that the code includes a script:[HTML]<script src="/ShoptalkProduction/CuteSoft_Client/CuteEditor/Load.ashx?type=scripts&amp;file=IE_Loader">[/HTML] This may contain the code which attaches the initialize and change events.
Nov 8 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.