Foren: 公開ディスカッション (Thread #28146)

テキストボックスでの編集方法 (2010-12-15 17:13 by hokenservlet #54752)

選択状態になったテキストボックス内の文字列(最大桁到達時)を変更する方法につきまして

文字列が入力最大桁に達している場合、一旦、削除しないと変更できません。

操作性が悪いので、削除せず上書き編集したいのですが、設定変更等で対応できるのでしょうか。

ご教授いただきたくお願いします。

maskat v2.1.0
ブラウザ IE6.0,IE7.0

Reply to #54752×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: テキストボックスでの編集方法 (2010-12-15 20:29 by uchidahd #54755)

> 選択状態になったテキストボックス内の文字列(最大桁到達時)を変更する方法につきまして
> 文字列が入力最大桁に達している場合、一旦、削除しないと変更できません。

質問の内容は、
nbchar属性に 5 を設定した場合に、
1,2,3,4,5,6と入力していくと「12345」となり、それ以上入力できない。
ということでしょうか。

もしそうであれば、この動作は一般的なHTMLのinputと同様であり、
仕様となっております。

> 操作性が悪いので、削除せず上書き編集したいのですが、
設定等でこのような動作にすることはできません。



もし質問の内容が上記と異なるようでしたら、
設定や条件、手順等について詳しく教えてください。
Reply to #54752

Reply to #54755×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: テキストボックスでの編集方法 (2010-12-16 10:00 by hokenservlet #54761)

説明不足で誠に申し訳ございません。

登録ずみのレコードを呼び出し、修正する時のことです。

nbchar属性に 5 を設定したテキストボックスの内容が'12345'の時で
それを修正する時、
①フォーカスを当てると、12345が全選択状態となる。
②その状態では、入力値が受け付けられない
(いったん削除して入力は可能。当然ですが。)

次のケースは大丈夫です。
nbchar属性に 6 を設定したテキストボックスに'12345'が入っており、
①フォーカスを当てると、12345が全選択状態となる。
②その状態では、入力値が受け付けられます。
※上記との違いは桁数が最大値に到達していないことです。

お手数をおかけしますが、よろしくご回答ください。

Reply to #54755

Reply to #54761×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: テキストボックスでの編集方法 (2010-12-16 13:28 by nakamuta #54776)

> uchiさん
全選択状態で、入力を行うと普通全選択中の文字が全部消えて、
入力した文字だけになりますよね?

↑これが通常のHTMLの仕様です。

最大入力可能文字数が5文字で、すでに5文字入力されていても、
全選択状態であれば、文字が消えて入力した文字が入力される仕様が自然ですね。

キャレットがselect(全選択)ではなく、テキストボックス内にある場合は、
入力可能文字数を超える入力はできません。

恐らく自作のmaxlength制御で、onkeydownで制御されているのではないでしょうか。
FWで。
Reply to #54755

Reply to #54776×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: テキストボックスでの編集方法 (2010-12-16 14:37 by hokenservlet #54784)

情報を追加させていただきます。(テキストボックスの文字列編集)

Firefox 3.6.6では、特に問題なく上書きできます。

また、特にonkeydownで制御せず、nbcharだけ設定しております。

同じ経験をされた方、また対応をご存知の方がいらっしゃれば、
ご回答いただきたくお願いします。

Reply to #54776

Reply to #54784×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: テキストボックスでの編集方法 (2010-12-17 11:35 by uchidahd #54805)

フォーラムの過去の書き込みに同様の質問がありました。

http://sourceforge.jp/forum/forum.php?forum_id=9854&thread_id=20480

rialto.jsの7261行目付近を修正すれば解決できるようです
(/maskat/rialto/rialtoEngine/javascript/rialto.js)

rialto.widget.Text.prototype.checkKeyPress = function (evt) {
  :
  :
if ((this.champs.value.length + 1) > this.champs.maxlength) {
// 追記修正 Start
if ((document.selection ? document.selection.createRange().text : window.getSelection().toString()) != ""){
return true;
}
// 追記修正 End
if (window.event) {
return false;
} else {
var oldSelectionStart = this.champs.selectionStart;
  :
  :
Reply to #54784

Reply to #54805×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: テキストボックスでの編集方法 (2010-12-21 10:01 by hokenservlet #54896)

お忙しいところ、お手数をおかけしました。
rialt.jsを修正しましたところ、解決しました。

どうもありがとうございました。
今後ともよろしくお願いいたします。
Reply to #54805

Reply to #54896×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden