
Suppose there is a textbox or a text area and the user is supposed to enter any text.Suppose the user enters his text and his text contains a '(inverted comma) somewhere in his text.I fetch this data with request.getParameter() but when I execute the query to store in oracle it is showing error because of the '.I understand where the problem is.If the user does not enter ' then there is no problem while executing.But suppose the user gives it.How can I solve the error....

The given code will not allowed the user to enter any special characters.Check it.
<script>
function ch(){
var str=document.getElementById("text").value;
var desired = str.replace(/[^\w\s]/gi, '');
document.getElementById("text").value=desired;
}
</script>
<pre>
Enter String <input type="text" id="text" onkeydown="ch();">
</pre>

Then there is a restriction on the characters the user can enter.But how is it that sites like facebook,google and other sites allow the user??In these sites the user can easily enter whatever character he likes??Is there any other solution??
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.