This is a migrated thread and some comments may be shown as answers.

Problem with asp:button in Rad Window

1 Answer 77 Views
Window
This is a migrated thread and some comments may be shown as answers.
k f
Top achievements
Rank 1
k f asked on 20 Sep 2008, 04:28 PM
Have a rad window which has several rad text boxes and other controls to take info from a user.  When the page loads there is only a save button.  When any data is entered into an input control, on the OnValueChanged event I make a Clear button available.

The problem is it doesn't display in a Rad window.

Here's a sampe of what I have on the page.

<

telerik:RadTextBox ID="rTxtPrjSummary" runat="server" Width="550px" MaxLength="255" >
   <ClientEvents OnValueChanged="InputValueChanged"/>
</telerik:RadTextBox>

<

div style="margin-left: 75px; margin-top:25px">

<asp:Button ID="btnSave" runat="server" Text="Save" OnClientClick="if(!ProjectSaveButtonClick()) return false;" />

<span style="margin-left: 50px">

<asp:Button ID="btnUndo" runat="server" OnClientClick="if(!UndoBtnClick()) return false;" Style="visibility:hidden" />
</span>
</
div>

<script 

type

="text/javascript">

var

InputValueHasChanged = false;

function InputValueChanged(sender, args) {

InputValueHasChanged =

true;

var button = $get("<%= btnUndo.ClientID %>");

button.value = 'Clear';
button.style.visibility =

'visible';
}

function UndoBtnClick() {

if (confirm('Are you sure you would like to clear all fields')) {

$find(

"<%= rTxtPrjSummary.ClientID %>").clear();

var button = $get("<%= btnUndo.ClientID %>");

button.style.visibility =

'hidden';

}

}

</

script>

The result of the code is that btnUndo can't be seen on the page, however, if you move the mouse where the button should show, you can click the area and the OnClientClick function UndoBtnClick fires.

I'm having to resort to using the visibility because having problems just disabling the button and then trying to enable the button when the InputValueChanged fires.

Any ideas?
P.S.  To see the results, check out http://n-sv.net/projexUI  under the menu on the left, click on New Project.  Type something in the summary text box and tab out.  Once you do that, click to the right of the Save button about an inch and you'll see that the onclientClick fires even you can visually see a button on the screen.

1 Answer, 1 is accepted

Sort by
0
k f
Top achievements
Rank 1
answered on 21 Sep 2008, 02:56 AM
Looks like there are numerous bugs with the RadFormDecorator.  Had some other issues on the page trying to set values of other controls in javascript.  Some throwing unexplained exceptions.

After going back through the page and removing the radFormDecorator, all problems went away.

Tags
Window
Asked by
k f
Top achievements
Rank 1
Answers by
k f
Top achievements
Rank 1
Share this question
or