테스트 사이트 - 개발 중인 베타 버전입니다

버튼클릭시 나타나지만 글수정시 유지가 되지 않네요. 채택완료

큰바위 6년 전 조회 2,237

안녕하세요. 눈팅으로 거의 해결했지만 아무리 해도 안되서 문의합니다.

 

영카트 문의글 보면서

입력필드테이블을 버튼으로 추가해서 추가인원이 있을경우 더 입력할 수 있게 버튼을 만들었습니다.

 

문제는 글을 수정하면 

버튼으로 추가한 테이블들은 다시 닫혀 있습니다. (내용은 유지됩니다. 다시 버튼을 눌러야 보입니다.)

 

버튼으로 추가해서 입력한 테이블에 내용이 있으면

글 수정시 추가한 테이블이 버튼을 누르지 않아도 보이게 할 수 없을까요?

 

</strong></p>

<p><table class="div-table table">

  <col width="200">

<tbody>

  <tr>

    <th scope="row" >이름</th>

     <th><input name="wr_8" type="text" class="frm_input" value="<?=$wr_8?>" size="20">

</th></tr>

     

  <tr>

    <th scope="row" >연락처</th>

     <th><input name="wr_9" type="text" class="frm_input" value="<?=$wr_9?>" size="20">

</th></tr>    

        

  <tr>

    <th scope="row" >소속</th>

     <th><input name="wr_10" type="text" class="frm_input" value="<?=$wr_10?>" size="20">

</th></tr>         

 

  <tr><th colspan="2" bgcolor="#Ffffff" style="text-align:right;" scope="row">

 <button type="button" id="tg_Btn">인원 추가/닫기</button></p>

<p><script>

$(document).ready(function(){</p>

<p>$('#tg_Btn').click(function(){</p>

<p>$('#pro2').fadeToggle();  //버튼클릭시 나타나고 사라지고</p>

<p>});</p>

<p>});

</script></th></tr> 

 </tbody> 

</table></p>

<p> </p>

<p> </p>

<p><!-- 추가인원 --> 

<table id="pro2" style="display:none"  class="div-table table">

  <col width="200">

<tbody>

  <tr>

    <th scope="row" >이름</th>

     <th><input name="wr_11" type="text" class="frm_input" value="<?=$wr_11?>" size="20">

</th></tr>

     

  <tr>

    <th scope="row" >연락처</th>

     <th><input name="wr_12" type="text" class="frm_input" value="<?=$wr_12?>" size="20">

</th></tr>    

        

  <tr>

    <th scope="row" >소속</th>

     <th><input name="wr_13" type="text" class="frm_input" value="<?=$wr_13?>" size="20">

</th></tr></p>

<p>  <tr><th colspan="2" bgcolor="#Ffffff" style="text-align:right;" scope="row">

 <button type="button" id="tg_Btn2">인원 추가/닫기</button></p>

<p><script>

$(document).ready(function(){</p>

<p>$('#tg_Btn2').click(function(){</p>

<p>$('#pro3').fadeToggle();  //버튼클릭시 나타나고 사라지고</p>

<p>});</p>

<p>});

</script></th></tr> 

 </tbody> 

</table></p>

<p><strong>

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
6년 전

</p>

<p><table id="pro2" style="<?php if($wr_11) echo "display:block;"; else echo "display:none";?> class="div-table table"></p>

<p>

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

큰바위
6년 전
답변 감사합니다.
위 소스 적용해보니 수정할때는 잘되지만 처음 글쓰기할때도 추가입력필드가 보입니다.
처음 글쓰기 할때는 추가필드가 보이지 않다가 추가필드를 생성하거나 입력하면 글 수정시
보이게 할 수는 없나요?
큰바위
6년 전
볼피드님 너무 감사합니다. 빠트린거 밑에 온리밀크님이 수정해 주셔서 해결했습니다.

댓글을 작성하려면 로그인이 필요합니다.

o
6년 전

볼피드님이 잘 해결해 주셨네요 .  

style="display:block;"; else echo "display:none";?> 에 실수로 " 부분을 빠뜨리신듯합니다. 

style="display:block;"; else echo "display:none";?>" ("만 넣어 주시면 되실듯합니다);

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

큰바위
6년 전
답변 너무 감사합니다.
잘 되는거 같습니다. 좋은 하루 되세요.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

© 2025 SIRSOFT. All rights reserved.