|
-
Oct 4th, 2002, 09:39 PM
#1
Thread Starter
New Member
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>"
-
Oct 5th, 2002, 12:24 AM
#2
Frenzied Member
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.
-
Oct 5th, 2002, 01:25 AM
#3
Member
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.....
-
Oct 5th, 2002, 04:28 AM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|