Results 1 to 4 of 4

Thread: replace function.....

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    4

    replace function.....

    hi
    i have one textfield to replace single quote and double quote into 2 single quotes but when i display i can onli display single quote but for the double quote i did not displayed out so can enlightened me...thank alot..


    countryName = repalce(request.form("CountryNameTF"), "'", "''")
    countryName = replace(request.form("CountryNameTF")), chr(34), "''")

    response.write "<td width='15%' height='20' valign='top'>" response.write Country_ID
    response.write "</td><input type='hidden' name='CountryID' value="
    response.write Country_ID
    response.write ">"
    response.write "<td width='30%' height='20' valign='top'><input type='text' name='CountryNameTF' value="""
    response.write trim(CountryName)
    response.write """ size='30' maxlength='50' class='formtextfield'>" response.write "<td width='10%' height='20' valign='top'><input type='button' value='"
    response.write localizedData(lang, UpdateBtn)
    response.write "' name='submit_but' class='formbutton' onClick='submit_but_onclick();'></td>" response.write "<td width='10%' height='20' valign='top'></td>"

  2. #2
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    I'm not really clear what you trying to do. Do you want display Country Name in quotes, double or single?
    Please write an example of Country Name, how you want to see it.

  3. #3
    Member
    Join Date
    Sep 2002
    Location
    PAKISTAN
    Posts
    54

    Re: replace function.....

    Originally posted by heero
    hi
    i have one textfield to replace single quote and double quote into 2 single quotes but when i display i can onli display single quote but for the double quote i did not displayed out so can enlightened me...thank alot..


    countryName = repalce(request.form("CountryNameTF"), "'", "''")
    countryName = replace(request.form("CountryNameTF")), chr(34), "''")

    response.write "<td width='15%' height='20' valign='top'>" response.write Country_ID
    response.write "</td><input type='hidden' name='CountryID' value="
    response.write Country_ID
    response.write ">"
    response.write "<td width='30%' height='20' valign='top'><input type='text' name='CountryNameTF' value="""
    response.write trim(CountryName)
    response.write """ size='30' maxlength='50' class='formtextfield'>" response.write "<td width='10%' height='20' valign='top'><input type='button' value='"
    response.write localizedData(lang, UpdateBtn)
    response.write "' name='submit_but' class='formbutton' onClick='submit_but_onclick();'></td>" response.write "<td width='10%' height='20' valign='top'></td>"
    --------------------
    x = chr(34)


    countryName =x + request.form("CountryNameTF") + x

    mprint = "<td width='15%' height='20' valign='top'>" & countryName & "</td><input type='hidden' name='CountryID' value=" & Country_ID & ">"
    mprint = mprint & "<td width='30%' height='20' valign='top'><input type='text' name='CountryNameTF' value="&
    & trim(CountryName) &" size='30' maxlength='50' class='formtextfield'>" mprint = mprint & "<td width='10%' height='20' valign='top'><input type='button' value="&
    localizedData(lang, UpdateBtn)&" name='submit_but' class='formbutton' onClick='submit_but_onclick();'></td>"
    mprint = mprint & "<td width='10%' height='20' valign='top'></td>"

    response.write mprint

    -------------------------
    Try this Code.....
    Be Good Not Bad

  4. #4
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762

    Cool

    HI!!!

    try this

    c1 = repalce(request.form("CountryNameTF"), "'", "''")
    c2 = replace(c1, chr(34), "''")

    response.write c2

    the final value move into c2...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width