2 javascript questions

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

how would i use document.write to write this input box? i can do it without
quotes but i need them for my purpose

<input type="textbox" name="input" value="something">

i did this but it doesn't have the double quotes
document.write( '<input type="textbox" name="input" ' + 'value="' +
entereddata+ '">');

2.
filter(enetereddate);
how can i filter out single quotes double quotes and other character that
might cause problem from a string? this string will be added to the value
param of the textbox.


Thanks in advance,
Aaron
 
Hi Aaron,

This is weird. Quotes have always shown up for me. When you do a view
source what does that line look like? Is it the string you are assigning to
'value' that doesn't have quotes? As for your second question. What
problems are you trying to solve? Quotes, double quotes, and etc. won't
cause you problems web-wise. Are you having trouble adding those to your
database? Where is it that the problem is occuring? Good luck! Ken.
 
this will cause problem, say i enetered this in a textbox

sjdkfjdfkd "dfdfd" dfdfd

when i do document.write and write this to the value parameter of the new
textbox it will be like this

<input type=textbox name=input value=sjdkfjdfkd "dfdfd" dfdfd>

i would like a function that can replace the quotes in the input string to
&quot;
and also any other harmful characters

Thanks,
Aaron
 
Back
Top