webpy自带的form,当验证出错了,会生成包含有错误信息的html,我现在的需求是,只想获取到单纯的错误信息,不包含任何html标签。举个例子:
<form name="main" method="post">
<p class="error"> Try again, AmeriCAN:</p>
<table>
<tr>
<th>
<label for="boe">boe</label>
</th>
<td>
<input type="text" id="boe" value="12" name="boe"/>
</td>
</tr>
<tr>
<th>
<label for="bax">bax</label>
</th>
<td>
<input type="text" id="bax" value="1" name="bax"/>
<strong class="wrong">Must be more than 5</strong>
</td>
</tr>
<tr>
<th>
<label for="moe">moe</label>
</th>
<td>
<textarea id="moe" name="moe">aaaaa</textarea>
</td>
</tr>
<tr>
<th>
<label for="curly_">curly</label>
</th>
<td>
<input checked="checked" type="checkbox" id="curly_" value="" name="curly"/>
</td>
</tr>
<tr>
<th>
<label for="french">french</label>
</th>
<td>
<select id="french" name="french">
<option value="mustard">mustard</option>
<option value="fries">fries</option>
<option value="wine">wine</option>
</select>
</td>
</tr>
</table>
<input type="submit" />
</form>
上面是验证出错后返回的form,我现在只想要“Must be more than 5”,应该怎么做?
<form name="main" method="post">
<p class="error"> Try again, AmeriCAN:</p>
<table>
<tr>
<th>
<label for="boe">boe</label>
</th>
<td>
<input type="text" id="boe" value="12" name="boe"/>
</td>
</tr>
<tr>
<th>
<label for="bax">bax</label>
</th>
<td>
<input type="text" id="bax" value="1" name="bax"/>
<strong class="wrong">Must be more than 5</strong>
</td>
</tr>
<tr>
<th>
<label for="moe">moe</label>
</th>
<td>
<textarea id="moe" name="moe">aaaaa</textarea>
</td>
</tr>
<tr>
<th>
<label for="curly_">curly</label>
</th>
<td>
<input checked="checked" type="checkbox" id="curly_" value="" name="curly"/>
</td>
</tr>
<tr>
<th>
<label for="french">french</label>
</th>
<td>
<select id="french" name="french">
<option value="mustard">mustard</option>
<option value="fries">fries</option>
<option value="wine">wine</option>
</select>
</td>
</tr>
</table>
<input type="submit" />
</form>
上面是验证出错后返回的form,我现在只想要“Must be more than 5”,应该怎么做?