English 中文(简体)
页: 1 仅读数 = 仅为形式明确的一部分
原标题:jQuery if readonly = true only clear part of form

我有2个座右铭1st,只读,2个是提交表格。

www.un.org/spanish/ecosoc 仅读:

$( #lock ).toggle( function () {
    $( #handle ).attr( readonly , true).addClass( disabled );
return false;
 } , function() {
  $( #handle ).attr( readonly , false).removeClass( disabled );
return false;
});

http://www.un.org。

$( button ).click(function() {
var handle     = $( #handle ).val();
var msg        = $( #msg ).val();
var dataString =  handle= + handle +  &msg=  + msg;

if(handle==   || msg==  ) {
$( .error ).fadeOut(200).show();
} else {

$.ajax({
  type    :  POST ,
  url     :  form.php ,
  data    : dataString,
  success : function(){
$( #foo ).load( page.php );
}}
 });
}
 return false;
});

What I am trying to achieve is

<>m>如果读到仅 = 真的不重新打造“实值”

否则,我都需要获得第1版(仅读)的地位,允许第2版(原)区分其真实或虚假。

我成功地尝试了这一努力:但是它还是没有工作了。

if($( #handle ).attr( readonly , true)){
    $( #msg ).val(  );
    }else{
    $( #handle, #msg ).val(  );
最佳回答

而用的是:

if ($( #handle ).is( [readonly] )) {
    $( #msg ).val(  );
}
else {
    $( #handle, #msg ).val(  );
}

供使用

​$( #handle ).prop( readonly , true)

而不是

$( #handle ).attr( readonly , true)
问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签