Load some data from database and hide it somewhere in a web page
- by kwokwai
Hi all,
I am trying to load some data (which may be up to a few thousands words) from
the database, and store the data somewhere in a html web page for comparing the data input by
users.
I am thinking to load the data to a Textarea under Div tag and hide the the data:
<Div id="reference" style="Display:none;">
<textarea rows="2" cols="20" id="database">
html, htm, php, asp, jsp, aspx, ctp, thtml, xml, xsl...
</textarea>
</Div>
<table border=0 width="100%">
<tr>
<td>Username</td>
<td>
<div id="username">
<input type="text" name="data" id="data">
</div>
</td>
</tr>
</table>
<script>
$(document).ready(function(){
//comparing the data loaded from database with the user's input
if($("#data").val()==$("#database").val())
{alert("error");}
});
</script>
I am not sure if this is the best way to do it, so
could you give me some advice and suggest your methods please.