JavaScriptで文字列の "[任意の数]"をテストする必要があります。どのように私はそれに一致するだろうか?正規表現[任意の番号]
ああ、「[」と「]」も一致させる必要があります。
"[1]"や "[12345]"のような文字列は一致します。
非一致: "[23432" または "1]" は、例えばので
:アイテム」に "アイテム[0] .firstname":私は入力を交換する必要が
$('.form .section .parent').find('input.text').each(function(index){
$(this).attr("name", $(this).attr("name").replace("[current]", "['"+index+"']"));
});
が名をフィールド[1] .firstname」 感謝
http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric – mdrg