0

I have got stuck in a dump issue but am not able to work it out , I have a range selection of age through two select input buttons. I took the code from the mark up and it works on the fiddle but not on the page.

I have tried putting the script on the view file,layout header and at the end of view.

But it never worked.

4

1 に答える 1

1

JSエラーがあるはずです。FirefoxのFirebugまたはGoogleChromeのChromeInspectorを使用して発生する可能性のあるエラーを追跡します。CakephpページにjQuery.jsが含まれていることを確認してください。また、すべてのブラウザでサポートされているわけではないため、ブラウザ固有の問題がある場合はPolyfillを使用できます。

更新:

2番目の入力をクリックして最初の入力の値を取得する代わりに、別のアプローチを試してみましょう。最初の入力を変更して2番目の入力の値を設定しようとするとどうなりますか。

$("input#range1").bind('change',function(){
   $("input#range2").val(this.value);
});

デモ: http: //jsfiddle.net/VBrEj/12/

于 2012-08-14T06:17:40.773 に答える