html - jQuery toggle removes input type checkbox -


I have a checkbox that will update the value of $ ('# express') There is an input text box. If I use .click instead of .toggle , the checkbox will be hidden.

Is the reason why my checkbox is deleted or invisible?

HTML & lt; Form id = "addupload" method = "post" action = "order_history / lightbox / mini-upload-form /upload.php" antipay = "multipart / form-data" & gt; & Lt; Div id = "upload" & gt; & Lt; Div id = "drop" & gt; Drop here & lt; A & gt; Browse & lt; / A & gt; & Lt; Input id = "uplo" type = "file" name = "upl" /> & Lt; / Div & gt; & Lt; Ul & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Div id = "formcontent" & gt; & Lt; Label class = "unitprice" title = "unit value" & gt; & Lt; Input type = "text" id = "unitprice" name = "unitprice" /> unit value & lt; / Label & gt; Label class = "required" for & lt; Label class = "required" = "qty" = "How many PCs" & gt; & Gt; Input type = "text" id = "qty" name = "qty" /> Quanity & lt; / Label & gt; & Lt; Label class = "express" = "express" title = "express in China" & gt; & Gt; Input type = "text" id = "express" name = "express" /> Express & lt; / Label & gt; & Lt; Label class = "linkur" = "linkURL" title = "insert a complete URL http: \\" & gt; Input type = "text" id = "linkURL" name = "link URL" /> Link & lt; / Labels & gt; & Lt; label for = "yourdesc" title = "Describe your requirement clearly" & gt; Details & lt; textarea id = "yourdesc" name = "yourdesc" & gt; & Lt; / Textarea & gt; & Lt; / Labels & gt; & Lt; Label = "shunfeng" title = "RMB25 for SF 1kg" & gt; Express? & Lt; Input type = "checkbox" id = "shunfeng" class = "shunfeng" name = "shunfeng" /> & Lt; / Labels & gt; & Lt; Label for "formsubmit" class = "nocontent" id = "uptest" & gt; Input type = "button" id = "submitbutton" href = "#" class = "progress-button" onClick = "upload)" value = "add to command" /> & Lt; Strong & gt; Note: & lt; / strong> Item marked & lt; img src = "order_history / images / required.jpg" alt = "required marker" width = "20" height = "20" /> Required fields are & lt; / Label & gt; & Lt; / Div & gt; & Lt; / Form & gt;

JQUERY

  $ ("# shunfeng"). Toggle (function () ($ ('# express') .val ("25");}, function () {$ ('# express'). Val ("0");});   

CSS

  .shunfeng {width: 15px; Height: 15px;}    

function $ Toggle (fn, fn)); which you are using was deprecated in jQuery 1.8 and has been removed in jQuery 1.9

Also I think you need to change the change (function () {if (this.checked) {$ ('# express'). Val ("25") event

  $ ("# shunfeng"); // If the checked value is 25} and {$ ('# express'). Val ("0"); // If the unchecked set Value 0}});    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -