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

new line in spell check control while checking multiple controls..Urgenttttttt

3 Answers 44 Views
Spell
This is a migrated thread and some comments may be shown as answers.
SANNIDHI
Top achievements
Rank 1
SANNIDHI asked on 12 Jun 2012, 09:05 AM
The spell check control inserts a newline when the control is empty. Is there anyway i can avoid that. I have attached a screenshot of the problem.

One way i was thinking about doing it was dynamically adding/removing controls to the spellcheck depending on the content of the controls.

You can reproduce the behavior on your demo page.
http://demos.telerik.com/aspnet-ajax/spell/examples/multiplechecks/defaultcs.aspx

3 Answers, 1 is accepted

Sort by
0
Jack
Top achievements
Rank 1
answered on 10 Jul 2012, 04:34 PM
I am experiencing the same issue.  Is there a work around for this problem?
0
Princy
Top achievements
Rank 2
answered on 11 Jul 2012, 10:43 AM
Hi,

Try the following Javascript to achieve your scenario.

JS:
<script type="text/javascript">
 var controls;
 function OnClientCheckStarted(sender, args)
 {
  controls = sender._textSource.get_elements();
  var control;
  var count = 0;
  var toCheck = new Array();
  for (i = 0; i < controls.length; i++)
  {
   if ("" != sender._textSource._elements[i].get_text())
   {
    toCheck[count] = controls[i];
    count++;
   }
  }
  sender._textSource.set_elements(toCheck);
 }
 function OnClientDialogClosed(sender, args)
 {
  var check = $find("<%=RadSpell1.ClientID %>");
  check._textSource.set_elements(controls);
 }
</script>

Hope this helps.

Thanks,
Princy.
0
Jack
Top achievements
Rank 1
answered on 11 Jul 2012, 01:01 PM
Princy, that achieved exactly what I was looking for, thank you.

Jack
Tags
Spell
Asked by
SANNIDHI
Top achievements
Rank 1
Answers by
Jack
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or