Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double Quote Problem

Status
Not open for further replies.

altendew

Programmer
Joined
Mar 29, 2005
Messages
154
Location
US
Hi Currently I am using this..

Code:
<script type="text/javascript">
var quote = '"';
</script>
<a href="" onClick="if(!confirm('Are you sure you want to delete this account? If yes, the downline of this user will be sent to the account '+ quote +' jerk '+ quote)) return false;">Test dont click!</a>

When the user click the link it says..

Are you sure you want to delete this account? If yes, the downline of this user will be sent to the account "jerk"

Is there a way to make the quotes without using a variable?
 
You can escape the quotes in Javascript:
Code:
<a href="" onClick="if(!confirm('Are you sure you want to delete this account? If yes, the downline of this user will be sent to the account [b][red]\"[/red][/b]jerk[b][red]\"[/red][/b]')) return false;">Test dont click!</a>

Lee
 
Yes I know you can.. but try to run that code it does not work.
 
Try:

Code:
<a href="" onclick="if(!confirm('Are you sure you want to delete this account? If yes, the downline of this user will be sent to the account \'jerk\'')) return false;">Test dont click!</a>

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
lol but i want double quotes. the way im using isnt a problem.. i was just wondering if there was a solution
 
Do this?
[tt] <a href="" onClick="if(!confirm('Are you sure you want to delete this account? If yes, the downline of this user will be sent to the account [blue]\x22jerk\x22[/blue]')) return false;">Test dont click!</a>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top