2 javascript questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron

    #1

    2 javascript questions

    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="somethin g">

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

    2.
    filter(enetered date);
    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


  • Ken Dopierala Jr.

    #2
    Re: 2 javascript questions

    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.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "Aaron" <kuya789@yahoo. com> wrote in message
    news:OzQeS1zrEH A.644@tk2msftng p13.phx.gbl...[color=blue]
    > how would i use document.write to write this input box? i can do it[/color]
    without[color=blue]
    > quotes but i need them for my purpose
    >
    > <input type="textbox" name="input" value="somethin g">
    >
    > i did this but it doesn't have the double quotes
    > document.write( '<input type="textbox" name="input" ' + 'value="' +
    > entereddata+ '">');
    >
    > 2.
    > filter(enetered date);
    > 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
    >
    >[/color]


    Comment

    • Aaron

      #3
      Re: 2 javascript questions

      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=sjdkfjdfk d "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




      "Ken Dopierala Jr." <kdopierala2@wi .rr.com> wrote in message
      news:e06tO9zrEH A.348@TK2MSFTNG P15.phx.gbl...[color=blue]
      > 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.
      >
      > --
      > Ken Dopierala Jr.
      > For great ASP.Net web hosting try:
      > http://www.webhost4life.com/default.asp?refid=Spinlight
      > If you sign up under me and need help, email me.
      >
      > "Aaron" <kuya789@yahoo. com> wrote in message
      > news:OzQeS1zrEH A.644@tk2msftng p13.phx.gbl...[color=green]
      >> how would i use document.write to write this input box? i can do it[/color]
      > without[color=green]
      >> quotes but i need them for my purpose
      >>
      >> <input type="textbox" name="input" value="somethin g">
      >>
      >> i did this but it doesn't have the double quotes
      >> document.write( '<input type="textbox" name="input" ' + 'value="' +
      >> entereddata+ '">');
      >>
      >> 2.
      >> filter(enetered date);
      >> 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
      >>
      >>[/color]
      >
      >[/color]


      Comment

      Working...