Home Search Member List Faq Register Login  
UltimateSpellMVC
TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.

Thread Starter: gauri.rane   Started: 02-25-2013 1:49 AM   Replies: 3
 Karamasoft Support Forums » General Discussions » UltimateSpellMVC » TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.
 Printable Version    « Previous Thread   Next Thread »
  25 Feb 2013, 1:49 AM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.
Hi,

I m developing an application where i need to specify max length to a textbox.
For Eg:
/*--- Specifying MaxLength to a textarea---------*/

textArea1 <textarea id="textArPopUP1" class="spell" asso_id="textArPopUP___1" maxlength="20"></textarea>
@(Html.UltimateSpellMVC()
.ID("textArPopUP___1")
//.AutoCorrect(true)
//.CapitalizeFirstLetterOfSentences(true)
//.SpellAsYouType(true)
.IgnoreHtmlTags(true)
.SpellButton(sbs => sbs
.Height(40)
.Width(60)
.CSSClass("buttonSmall buttonGreen")
.BackColor(System.Drawing.Color.RoyalBlue)
.Font(ViewBag.SpellButtonFont)
.ForeColor(System.Drawing.Color.White))
.CustomDictionary("CustomEnglish")
.ShowAddButton(true)
//.ShowOptions(true)
.ControlIdsToCheck("textArPopUP1")
//.Dictionary("de-DE")
//.Language("German")
.Render())


I Used Ultimate Spell Checker. It will allow 20 characters only into that textbox. But When i click on SpellChecker button to spellCheck and if i type characters which exceed the maxlength, It will allow that characters too in a textbox. Is there any teqnique to remove characters which are exceeding its maxlength.

Thank you in Advance,
Gauri Rane

  
  25 Feb 2013, 10:38 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.
The maxlength field doesn't prevent JavaScript to update the text over the maximum length. You can try customizing the spell check dialog window (UltimateSpellInclude\UltimateSpell.spell.htm) by adding your own event handler for the OK button click event as can be seen at http://forums.karamasoft.com/ShowPost.aspx?PostID=7050. Then, in your custom event handler, you can check whether the textarea in the opener window exceeded its character limit by comparing the length of its text and the maxlength property and truncate the text accordingly.
  
  26 Feb 2013, 8:13 PM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
Re: TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.
Hi,

Pls can you show me with an example. I tried to write code on click of OK button. But Simple Alert code is also not working.

Here is my code,


$('#btnOK').click(function () {
alert('Inside OK button of Spell Checker');
});

Thanks in Advance,
Gauri Rane

  
  26 Feb 2013, 11:21 PM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.

UltimateSpell.spell.htm doesn't include any jQuery libraries so you can't use the $ method.

Please try adding the event handler as explained at http://forums.karamasoft.com/ShowPost.aspx?PostID=7050 as follows:

<input type="button" id="btnOK" class="Button" onclick="HandleUSDOKClick(); YourCustomOKHandler();" NAME="btnOK">

 

 


  
 Page 1 of 1 (4 items)
Karamasoft Support Forums » General Discussions » UltimateSpellMVC » TextBox MaxLength Attribute Ignored when we used UltimateSpell popup.

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.