Ajax调用两次导致重复消息

时间:2016-01-06 05:11:38

标签: php jquery ajax wordpress

我试图找出问题ajax调用两次如此重复的消息。我第一次点击sendPLR按钮,消息就不会出现。然后再次单击按钮时会显示两次消息。我检查了Chrome上的网络标签,它也没有显示第一个ajax调用。再次按下按钮时会显示重复的呼叫。这是我的HTML代码。这是我第一次像这样处理大型表格。请帮忙!!!!我用wordpress

<form id="frmBegin" method="post">
<div id="plr_radioselection">
<div id="plr_radioform">Business Unit: <input type="radio" name="plr_location" value="Company">Company (Corp) | <input type="radio" name="plr_location" value="BU">Other than Corp</div>
<div id="plr_radiocat">Reporting Category: <input type="radio" name="plr_category" value="Director">Director | <input type="radio" name="plr_category" value="Seniorteam">Senior Team | <input type="radio" name="plr_category" value="BU">BU/GM/Sales | <input type="radio" name="plr_category" value="Salariedteam">Salaried Team</div>
</div>
<div id="plrFormBegin">
<h4>Step 1 &#8211; Financial Objectives</h4>
<div>
<div class='plr_form'>
<p>For an explanation of respective criteria matrices, please click on category name.</p>
<h5>Objective 1 &#8211; EBITDA Achievement</h5>
<div class='objt_weigtht'>Weight: <input type='number' id='fobjt1_weight' value='0.5' required></div>
<div class='field'>
        <label for=''>Company Metrics EBITDA Rating:</label>  <select class='plr_ratingdropdown' id='fobjt1_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select><br />Description: <br /><textarea id='fobjt1_desc'></textarea>
    </div>
<div class='field'>
        <label for=''>BU/Branch Metrics &#8211; 80% EBITDA Rating:</label>  <select class='plr_ratingdropdown' id='fobjt180_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select><br /><a href='#' class='popmake-2041'>Description:</a><br /><textarea id='fobjt180_desc'></textarea>
    </div>
<h5>Objective 2 &#8211; Revenue Achievement</h5>
<div class='objt_weigtht'>Weight: <input type='number' id='fobjt2_weight' value='0.5' required></div>
<div class='field'>
        <label for=''>Company Metrics Revenue Rating:</label>  <select class='plr_ratingdropdown' id='fobjt2_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select><br /><a href='#' class='popmake-2041'>Description:</a><br /><textarea id='fobjt2_desc'></textarea>
    </div>
<div class='field'>
        <label for=''>BU/Branch Metrics &#8211; 80% Revenue Rating:</label>  <select class='plr_ratingdropdown' id='fobjt280_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select><br /><a href='#' class='popmake-2041'>Description:</a><br /><textarea id='fobjt280_desc'></textarea>
    </div>
<h5>Objective 3 &#8211; Optional</h5>
<div class='objt_weigtht'>Weight: <input type='number' name='optional' id='fobjt3_weight' value='0'></div>
<div class='field'>
        <label for=''>Rating:</label>  <select class='plr_ratingdropdown' name='optional' id='fobjt3_rating'><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select><br /><a href='#' class='popmake-2041'>Description:</a> <br /><textarea name='optional' id='fobjt3_desc'></textarea><br /><a href='#' class='popmake-2020'>Result:</a><br /><textarea name='optional' id='fobjt3_result'></textarea></div>
</div>
</div>
<h4>Step 2 &#8211; Strategic Objectives</h4>
<div>
<div class='plr_form'>
<p>For an explanation of respective criteria matrices, please click on category name.</p>
<h5>Objective 1</h5>
<div class='objt_weigtht'>Weight:<input type='number' id='sobjt1_weight' value='0.33' required></div>
<div class='field'>
        <label for=''>Rating:</label>  <select class='plr_ratingdropdown' id='sobjt1_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2041'>Description:</a></label><br />
        <textarea id='sobjt1_desc' required></textarea>
    </div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2020'>Result:</a></label><br />
        <textarea id='sobjt1_result' required></textarea>
    </div>
<h5>Objective 2</h5>
<div class='objt_weigtht'>Weight:<input type='number' id='sobjt2_weight' value='0.33' required></div>
<div class='field'>
        <label for=''>Rating:</label>  <select class='plr_ratingdropdown' id='sobjt2_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2041'>Description:</a></label><br />
        <textarea id='sobjt2_desc' required></textarea>
    </div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2020'>Result:</a></label><br />
        <textarea id='sobjt2_result' required></textarea>
    </div>
<h5>Objective 3</h5>
<div class='objt_weigtht'>Weight:<input type='number' id='sobjt3_weight' value='0.33' required></div>
<div class='field'>
        <label for=''>Rating:</label>  <select class='plr_ratingdropdown' id='sobjt3_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.1'>0.1</option><option value='0.2'>0.2</option><option value='0.3'>0.3</option><option value='0.4'>0.4</option><option value='0.5'>0.5</option><option value='0.6'>0.6</option><option value='0.7'>0.7</option><option value='0.8'>0.8</option><option value='0.9'>0.9</option><option value='1.0'>1.0</option><option value='1.1'>1.1</option><option value='1.2'>1.2</option><option value='1.3'>1.3</option><option value='1.4'>1.4</option><option value='1.5'>1.5</option><option value='1.6'>1.6</option><option value='1.7'>1.7</option><option value='1.8'>1.8</option><option value='1.9'>1.9</option><option value='2.0'>2.0</option><option value='2.1'>2.1</option><option value='2.2'>2.2</option><option value='2.3'>2.3</option><option value='2.4'>2.4</option><option value='2.5'>2.5</option><option value='2.6'>2.6</option><option value='2.7'>2.7</option><option value='2.8'>2.8</option><option value='2.9'>2.9</option><option value='3.0'>3.0</option><option value='3.1'>3.1</option><option value='3.2'>3.2</option><option value='3.3'>3.3</option><option value='3.4'>3.4</option><option value='3.5'>3.5</option><option value='3.6'>3.6</option><option value='3.7'>3.7</option><option value='3.8'>3.8</option><option value='3.9'>3.9</option><option value='4.0'>4.0</option><option value='4.1'>4.1</option><option value='4.2'>4.2</option><option value='4.3'>4.3</option><option value='4.4'>4.4</option><option value='4.5'>4.5</option><option value='4.6'>4.6</option><option value='4.7'>4.7</option><option value='4.8'>4.8</option><option value='4.9'>4.9</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2041'>Description:</a></label><br />
        <textarea id='sobjt3_desc' required></textarea>
    </div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2020'>Result:</a></label><br />
        <textarea id='sobjt3_result' required></textarea>
    </div>
</div>
</div>
<h4>Step 3 &#8211; Leadership Model</h4>
<div>
<div class='plr_form'>
<p>For an explanation of respective criteria matrices, please click on category name.</p>
<div class='field'>
        <label for=''><a href='#' class='popmake-1948'>Customer Champion Rating:</a></label><br /><select class='plr_ratingdropdown' id='cc_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1823'>Performer Rating:</a></label><br /><select class='plr_ratingdropdown' id='per_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1826'>Strategic Thought Leader Rating:</a></label><br /><select class='plr_ratingdropdown' id='stl_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1836'>Driver of Change Rating:</a></label><br /><select class='plr_ratingdropdown' id='doc_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1838'>Developer of Talent Rating:</a></label><br /><select class='plr_ratingdropdown' id='dot_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1840'>Relationship Builder Rating:</a></label><br /><select class='plr_ratingdropdown' id='rb_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2020'>Results:</a></label><br />
        <textarea id='LM_resutlt' required></textarea>
    </div>
</div>
</div>
<h4>Step 4 &#8211; Patrick Values Model</h4>
<div>
<div class='plr_form'>
<p>For an explanation of respective criteria matrices, please click on category name.</p>
<div class='field'>
        <label for=''><a href='#' class='popmake-1847'>Teamwork Rating:</a></label><br /><select class='plr_ratingdropdown' id='teamwork_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1851'>Excellence Rating:</a></label><br /><select class='plr_ratingdropdown' id='excellence_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1845'>Respect Rating:</a></label><br /><select class='plr_ratingdropdown' id='respect_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1843'>Trust Rating:</a></label><br /><select class='plr_ratingdropdown' id='trust_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-1849'>Balance Rating:</a></label><br /><select class='plr_ratingdropdown' id='balance_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select></div>
<div class='field'>
        <label for=''><a href='#' class='popmake-2027'>Results:</a></label><br />
        <textarea id='PVM_result' required></textarea>
    </div>
</div>
</div>
<h4>Step 5 &#8211; Functional Role Model</h4>
<div>
<div class='plr_form'>Rating: <br /><select class='plr_ratingdropdown' id='FRP_rating' required><option selected='selected' value=''>&#8212;&#8212;</option><option value='0.0'>0.0</option><option value='0.5'>0.5</option><option value='1.0'>1.0</option><option value='1.5'>1.5</option><option value='2.0'>2.0</option><option value='2.5'>2.5</option><option value='3.0'>3.0</option><option value='3.5'>3.5</option><option value='4.0'>4.0</option><option value='4.5'>4.5</option><option value='5.0'>5.0</option></select>
<div class='field'>
            <label for=''>Results:</label><br />
            <textarea id='FRP_result' required></textarea>
        </div>
</p></div>
</div>
</div>
</form>
<p><input type='button' id='sendPLR' value='Submit' onclick='postPLRData();'></p>
<div id="plr_message"></div>

id =“plr_message”是消息显示的位置。下面是我的jquery代码

function postPLRData() {
    $j('#sendPLR').click(function(e) {
        e.preventDefault();
        $j.ajax({
            url: ajaxurl,
            type: 'POST',
            dataType: 'HTML',
            data: { action: 'submitPLR', PLRData: frmData },
            success: function(backData) {
                if (backData !== '') {
                    $j('#plr_message').append('Form has been submitted successfully');
                }
                else { 
                    $j('#plr_message').append('Ops!!!, form could not be submitted'); 
                }
            }
        });
    }); 
}

这是我的php代码

function insertPLR()
{
    $return      = array();
    $jsondecode  = $_POST['PLRData'];
    $queryUser = ($jsondecode['user'] === '') ? $jsoncode['user'] : wp_get_current_user()->user_login;
    echo json_encode($queryUser);
    die();
}
add_action('wp_ajax_submitPLR', 'insertPLR');

由于

1 个答案:

答案 0 :(得分:1)

{{1}}