I showInput()
Javascriptの機能が実行されない完全
という名前のJavaScript関数と、この関数は、唯一のポイントまで実行してい「( 『これは走る』)警告;」書かれた。
説明する別の方法は、私がエラーを把握しようとするとき、I placed the alert function at the same place as in the screenshot, and this alert function did not run
です。
エラーは何ですか?私は以前これが起こっているのを見たことがない。
この関数は、最初の4つのコマンドに対して実行され、終了します。
私は80GBのHDDと2GBのRAMを搭載したミント18を使用しているため、私のRAMが原因である可能性があります。 私を助けてください。私は数週間この奇妙な問題に悩まされています。 これはjavascriptのコード
<script language="JavaScript">
function showInput() {
document.getElementById('dusername').innerHTML =
document.getElementById('username').value;
document.getElementById('dfirstname').innerHTML =
document.getElementById('firstname').value;
document.getElementById('dpassword').innerHTML =
document.getElementById('password').value;
document.getElementById('dlastname').innerHTML =
document.getElementById('lastname').value;
alert('this run');
document.getElementById('dcity').innerHTML =
document.getElementById('city').value;
document.getElementById('daddress').innerHTML =
document.getElementById('address').value;
document.getElementById('dpincode').innerHTML =
document.getElementById('pincode').value;
document.getElementById('dlibname').innerHTML =
document.getElementById('libname').value;
document.getElementById('dlibcity').innerHTML =
document.getElementById('libcity').value;
document.getElementById('dlibaddress').innerHTML =
document.getElementById('libaddress').value;
}</script>
で今cakephp3コード:
<div class="linker">
<?= $this->Form->create(); ?>
<!--<form id="loginForm">-->
<div class="align">
<div id="firstStep"><br /><br /><br />
<p id="first">First Step</p>
<?php echo $this->Form->input('firstname');?>
<?php echo $this->Form->input('lastname');?>
<?php echo $this->Form->input('mobile');?>
<?php echo $this->Form->input('address'); ?>
<?php echo $this->Form->input('pincode'); ?>
<br/>
<button type="button" id="firstBtn" class="next1">Next</button>
</div>
<div id="secondStep"><br /><br /><br />
<p id="second">Second Step</p>
<?php echo $this->Form->input('lib_name'); ?>
<?php echo $this->Form->input('lib_city'); ?>
<?php echo $this->Form->input('lib_address'); ?>
<button type="button" id="secondBtn" class="next">Next</button>
<button type="button" id="secondBtnBack">Previous</button>
</div>
<div id="thirdStep"><br /><br /><br />
<p id="third">Third Step</p>
<?php echo $this->Form->input('username'); ?>
<?php echo $this->Form->input('password'); ?>
<button type="button" onclick="showInput();" id="thirdBtn" class="next" >Next</button>
<button type="button" id="thirdBtnBack">Previous</button>
</div>
<div id="fourthStep">
<p id="fourth">Fourth Step</p><br /><br /><br />
Useranme:<br />
<p><div id='dusername'></div></p>
Password:<br />
<p><div id='dpassword'></div></p>
First Name:<br />
<p><div id='dfirstname'></div></p>
Last Name:<br />
<p><div id='dlastname'></div></p>
City:<br />
<p><div id='dcity'></div></p>
Address:<br />
<p><div id='daddress'></div></p>
Pincode:<br />
<p><div id='dpincode'></div></p>
Lib Name:<br />
<p><div id='dlibname'></div></p>
Lib City:<br />
<p><div id='dlibcity'></div></p>
Lib Address:<br />
<p><div id='dlibaddress'></div></p>
<br/>
<button type="button" id="fourthBtnBack">Previous</button>
<input type="submit" id='sub_btn' value='Send Mail!' class="next"/>
</div>
</div>
</form>
</div>
一部の要素でコードがgetElementByID()に失敗している必要があります。最初に、getElementByID()を使用して取得しているすべての要素がhtmlページで実際に使用可能かどうかを確認します。 – Maharshi
この問題は、RAMやハードウェアに問題がないことは確かです。デベロッパーコンソールでエラーを探したり、ブレークポイントを設定してプログラムをデバッグしてみてください。 – 4castle
Stack Overflowを使用すると、スクリーンショットを撮ってimgurにアップロードし、ここへのリンクを投稿するよりも簡単にコードを投稿することができます。いくつかのコードを投稿してください。 – Vince