初質問させていただきます。
まだまだ初心者なんですがよろしくお願いします。
現在、bootstrap3のライブラリを使ってweb構築していて、思うように動きません。
写真選択ボタンを押し、画像選択ウィンドウで画像を選び、{display:none;}で非表示にしていたfileupボタンを表示させます。
fileupボタンを押してsubmitし、画像をアップさせることはできるんですが、submitした時にアップした写真を確認するためのfileup_Confirmationボタンを表示したいですが、(fileupボタンは、fileup_Cofirmationボタン表示の際に排他的にする)一瞬表示されてリロードしてしまいます。
色々調べてみるとajaxを使って画面遷移しない方法とかreturn false;をつかうとかありますが、うまくリロードさせずにボタン表示できません。
以下の内容です。どなたか解決策を教えてください。
<body> <p id="select"><a href="#" id="select_btn" class="btn btn-primary btn-lg">カメラ/写真選択</a></p> <p id="upload"><a href="#" id="upload_btn" class="btn btn-success btn-lg">Fileup</a></p> <form method="post" action="#" enctype="multipart/form-data" id="send_file"> <input type="file" accept="image/*" capture="camera" id="image_file" value="" name="upfile" style="opacity:0;"> <input type="hidden" id="lat" name="lat"> <input type="hidden" id="lon" name="lon"> <input type="hidden" name="file_upload_flg" value="1"> </form> <button class="up_button" type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#upfile_modal_show"> fileup_Confirmation </button> </dody> <script> //アップロードボタン ”Submit”で送信 $("#upload_btn").on("click", function(){ $("#send_file").submit(); return false; }); //アップロードボタン ”Submit”で送信後にfileup_Confirmationボタン表示 $("#upload_btn").on("click", function(){ $(".up_button").show(); }); </script>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。