javascript - replaceWith() for an option with a value for a drop down menu -


i have domain class consist of combobox dog , cat options , hav e textbox animal when choose dog want replace animal text box dog , when select cat want replace dog textbox cat, used jquery replacewith() replace first select animal->dog, when try select cat not changing dog -> cat

function showreadonly(valobj) {     var dogtr = '<tr><g:field name="dog" type=""value="${fieldvalue(bean:ainstance, field: '     dog ')}"/></tr>'     var cattr = '<tr><g:field name="cat" type=""value="${fieldvalue(bean:ainstance, field: '     cat ')}"/></tr>'     if (valobj == "dog") {         jquery("td#someid").parent().replacewith(dogtr);     } else if (valobj == "cat") {         jquery("td#someid").parent().replacewith(cattr);     } } 

can suggest me solution this


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -