私は現在のセレクタのクラスの "username"をjqueryのdialog.problemのユーザが提供するユーザ名で置き換えたいと思っています。$(this).attr() jqueryのダイアログボタンの内側にはjqueryのを参照しますだって事前jqueryダイアログ内の要素のクラスを変更します
<form action="#" method="post" >
</form>
<p id="text" class="www.username.google.com"> click me </p>
<div id="test" class="sandy" >
<input id="username" class="sandy1" />
</div>
でjQueryのdialog.Thanksにおけるユーザー入力で単語のユーザ名を交換する方法を提案しdialog.Please ============ ========================================== ================
$('#text').click(function(){
var provider_url= $(this).attr('class');
$('.sandy').dialog({
buttons: {
"OK": function() {
if($('#username').val() == '') {
$('#username').focus();
} else {
var myvalue= $("#username").val();
var nextval= replace(provider_url, username,myvalue);
$(this).dialog('close');
alert(nextval);
$('form').append(nextval);
$('form').submit();
}
}
}
});
});
jsfiddle code demoはここにhttp://jsfiddle.net/zCFD5/127/.Please助けてください
これはPHPとどのように関係しますか? – fhugas
私のHTMLコードはPHPで使用されていますが、簡略化のためにlatedを省略していますが、PHPに関連しないと言うことができます – user1364146
#textをクリックすると、id "username"をユーザーが提供するテキストに置き換えますか? – Gaurav