Linking probelms resulting from apostrophes

Results 1 to 10 of 10

Thread: Linking probelms resulting from apostrophes

  1. #1
    Join Date
    Dec 1969
    Posts
    144

    Default Linking probelms resulting from apostrophes

    I have been having trouble with the following when variable with an apostrophe is being passed into the querystring.<BR><BR>I am declaring 2 strings which I pass to a href so that they form links, represented by 2 images ie.e 1 an edit link and the other a delete link<BR><BR>The Edit link represented by strEditHref works perfectly when passed<BR><BR>The Delete link i.e. strDeleteHref is causing problems.<BR>-strDeleteHref<BR>If for example, the location that is passed in the querystring includes an apostrophe the link will not work. I have tried the replace, server.urlencode where I can but to no avail. I have used this setup in other pages and it is working fine, however in some cases I must use span onclick rather than a href as outlined below when setting up the links. Any ideas<BR><BR>strEditHref = "nt_location.asp?location=" & Server.urlEncode(Location) & "&nt_domain=" & Server.urlEncode(NTDomain) & "&type=EDIT"<BR><BR>strDeleteHref = "javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;" & Replace(Location, "&#039;", "&#039;") & "/" & Replace(NTDomain, "&#039;", "&#039;") & "&#039;?&#039;))" & _<BR>"location.href=&#039;nt_location.asp?location =" & Server.urlEncode(Location) & "&form_action=DELETE&nt_domain=" & Server.urlEncode(NTDomain) & "&#039;;"<BR> <BR> <BR><BR>Response.write "&#060;td class=""tblInfo""&#062;&#060;a href=""" & strEditHref & """&#062;&#060;image src=""../images/edit.gif"" border=0 alt=""Edit""&#062;&#060;/a&#062;&#060;a href=""" & strDeleteHref & """&#062;&#060;image src=""../images/delete.gif"" border=0 alt=""Delete""&#062;&#060;/a&#062;&#060;/td&#062;"<BR><BR><BR>I use either span onclick or a href in other pages to make similar links work <BR>Response.write "&#060;td class=""tblInfo""&#062;&#060;a href=""" & strEditHref & """&#062;&#060;image src=""../images/edit.gif"" border=0 alt=""Edit""&#062;&#060;/a&#062;&#060;a href=""" & strDeleteHref & """&#062;&#060;image src=""../images/delete.gif"" border=0 alt=""Delete""&#062;&#060;/a&#062;&#060;/td&#062;"<BR><BR> OR <BR>Response.write "&#060;td class=""tblInfo""&#062;&#060;a href=""" & strEditHref & """&#062;&#060;image src=""../images/edit.gif"" border=0 alt=""Edit""&#062;&#060;/a&#062;&#060;span onclick=""" & strDeleteHref & """&#062;&#060;image src=""../images/delete.gif"" border=0 alt=""Delete""&#062;&#060;/span&#062;&#060;/td&#062;"<BR> <BR>Any ideas<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default Show us the HTML...

    Bring up the ASP page in your browser.<BR><BR>Click on the VIEW menu at the top of the browser.<BR><BR>Click on the SOURCE menu item in that menu.<BR><BR>Now you&#039;ll be looking at HTML, with all the ugly generated JS code in place. Copy/paste the relevant portions of the HTML to this forum.<BR><BR>For example, find the chunk of HTML that corresponds to this:<BR><BR>&#060;a href=""" & strEditHref & """&#062;&#060;image src=""../images/edit.gif"" border=0 alt=""Edit""&#062;&#060;/a&#062;<BR><BR>and show it to us.<BR><BR>I *really* do not understand why Server.URLEncode didn&#039;t work for you. It worked perfectly on my machine using the example you gave yesterday.<BR><BR>************<BR><BR>On another topic: One way you could simplify your code would be to stop using Response.Write for ugly stuff like this. Yes, you *might* be gaining a *very very tiny* advantage in performance. But you are losing a *lot* or readability and debug-ability by doing so.<BR><BR>I&#039;d much rather see you coding:<BR><BR>...<BR>%&#062;<BR>&#060;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &#060;a href="&#060;%= strEditHref %&#062;"&#062;<BR>&nbsp; &nbsp; &#060;image src="../images/edit.gif" border=0 alt="Edit"&#062;<BR>&nbsp; &nbsp; &#060;/a&#062;<BR>&nbsp; &nbsp; &#060;a href="&#060;%= strDeleteHref %&#062;"&#062;<BR>&nbsp; &nbsp; &#060;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&nbsp; &nbsp; &#060;/a&#062;<BR>&#060;/td&#062;<BR><BR>Yes, with the line breaks as above, or similar.<BR><BR>If for no other reason than that now the code you see when you do "View &#124 Source" in the browser is readable instead of clumped into one huge undecipherable line.<BR><BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    144

    Default RE: Show us the HTML...

    &#060;/tr&#062;<BR> &#060;tr&#062;&#060;td height="20"&#062;&nbsp;&#060;/td&#062;&#060;/tr&#062;<BR> <BR> &#060;tr&#062;&#060;td&#062;&#060;table border="0" width="100%" cellspacing="1" cellpadding="0"&#062;&#060;tr&#062;&#060;td class="tblHeader" nowrap&#062;Action&#060;/td&#062;&#060;td class="tblHeader" nowrap&#062;NT Domain&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td class="tblInfo"&#062;&#060;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL&type=EDIT"&#062;&#060;image src="../images/edit.gif" border=0 alt="Edit"&#062;&#060;/a&#062;&#060;a href="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;))location.href=&#039;nt_locat ion.asp?location=CAROL%27S+TEST&form_action=DELETE &nt_domain=CAPITAL&#039;;"&#062;&#060;image src="../images/delete.gif" border=0 alt="Delete"&#062;&#060;/a&#062;&#060;/td&#062;&#060;td class="tblInfo"&#062;CAPITAL&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td class="tblInfo"&#062;&#060;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL%28TEST%29&type=EDIT"&#062;&#060;imag e src="../images/edit.gif" border=0 alt="Edit"&#062;&#060;/a&#062;&#060;a href="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL(TEST)&#039;?&#039;))location.href=&#039;nt _location.asp?location=CAROL%27S+TEST&form_action= DELETE&nt_domain=CAPITAL%28TEST%29&#039;;"&#062;&# 060;image src="../images/delete.gif" border=0 alt="Delete"&#062;&#060;/a&#062;&#060;/td&#062;&#060;td class="tblInfo"&#062;CAPITAL(TEST)&#060;/td&#062;&#060;/tr&#062;<BR>&#060;/table&#062;<BR>&#060;/td&#062;&#060;/tr&#062;

  4. #4
    Join Date
    Dec 1969
    Posts
    96,118

    Default Good stuff!

    I presume that examples like this one work okay? That is, when all you are doing is setting the HREF?<BR><BR>&#060;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL&type=EDIT"&#062;<BR>&#060;image src="../images/edit.gif" border=0 alt="Edit"&#062;<BR>&#060;/a&#062;<BR><BR>And then this is an example of a problem, yes?<BR><BR>&#060;a href="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;))location.href=&#039;nt_locat ion.asp?location=CAROL%27S+TEST&form_action=DELETE &nt_domain=CAPITAL&#039;;"&#062;<BR>&#060;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&#060;/a&#062;<BR><BR>**************************<BR><BR>V ery interesting! I *do* get an error from MSIE when I try to use that. Back to you soon...<BR><BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    96,118

    Default Got it to work...

    I dunno why it doesn&#039;t work, as is. But it must have something to do with that "javascript:..." prefix in the HREF.<BR><BR>I&#039;d always been told that using<BR>&#060;A HREF="javascript:..."&#062; <BR>was a bad idea, and now I&#039;m convinced!<BR><BR>The usual way you are advised to do this is:<BR>&#060;A HREF="#" onClick="...code...; return false;"&#062;<BR><BR>The "return false;" is important: It prevents the actual HREF from firing (not that this is a big deal when you use HREF="#", but still...).<BR><BR>So I made your example work by converting it to this:<BR><BR>********************<BR><BR>&lt;SCRIP T&#062;<BR>function tryit( )<BR>{<BR>&nbsp; &nbsp; if ( confirm(&#039;Warning: Are you sure that you want to &#039;<BR>&nbsp; &nbsp; &nbsp; &nbsp; + &#039;delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;) )<BR>&nbsp; &nbsp; &nbsp; &nbsp; location.href = <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;nt_location.asp?location=CAROL%27S+TEST&form _action=DELETE&nt_domain=CAPITAL&#039;;<BR>&nbsp; &nbsp; return false;<BR>}<BR>&lt;/SCRIPT&#062;<BR><BR>&lt;a href="#" onClick="return tryit();"&#062;<BR>&lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&lt;/a&#062;<BR><BR>*****************************<BR><B R>Now, it would be pretty ugly to have to create a JS function like that for each &#060;A HREF...&#062;, so I played with it a bit more and came up with this (somewhat ugly, but workable) alternative:<BR><BR>*****************************< BR>&lt;a href="#" <BR>&nbsp; &nbsp; onClick="if ( confirm(&#039;Warning: Are you sure that you want to &#039;<BR>&nbsp; &nbsp; &nbsp; &nbsp; + &#039;delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;) )<BR>&nbsp; &nbsp; &nbsp; &nbsp; location.href = <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;nt_location.asp?location=CAROL%27S+TEST&form _action=DELETE&nt_domain=CAPITAL&#039;;<BR>&nbsp; &nbsp; &nbsp; &nbsp; return false;"<BR>&#062;<BR>&lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&lt;/a&#062;<BR>*****************************<BR><BR>Fi nally, though, I&#039;d like to suggest another way:<BR><BR>&lt;SCRIPT&#062;<BR>function checkDelete( loc, act, dom )<BR>{<BR>&nbsp; &nbsp; if ( confirm("Warning: Are you sure that you want to "<BR>&nbsp; &nbsp; &nbsp; &nbsp; + "delete NT Location/Domain &#039;" + loc + "&#039;?") )<BR>&nbsp; &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; location.href = "nt_location.asp"<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + "?location=" + escape( loc )<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + "&form_action=" + escape(act) <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + "&nt_domain=" + escape( dom );<BR>&nbsp; &nbsp; }<BR>&nbsp; &nbsp; return false;<BR>}<BR>&lt;/SCRIPT&#062;<BR>&lt;a href="#" onClick="return checkDelete(&#039;CAROL&#039;S TEST&#039;,&#039;DELETE&#039;,&#039;CAPITAL&#039;) ;"&#062;<BR>&lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&lt;/a&#062;<BR><BR>***************************<BR><BR> By using a common function, you keep the amount of code you have to generate per-HREF to a relative minimum.<BR><BR>

  6. #6
    Join Date
    Dec 1969
    Posts
    96,118

    Default And by the way...

    ...my apologies if I ticked you off in the Advanced forum the other day.<BR><BR>I hope you understand that, compared to this sequence of posts, there was simply no info in there for us to work on. And given the way that MSIE is rejecting what looks to me like perfectly legit JS coding, I guess maybe I have to bite my tongue about it not being advanced. If it&#039;s worth anything, you win the points.<BR><BR>

  7. #7
    Join Date
    Dec 1969
    Posts
    144

    Default RE: And by the way...

    Thanks..its working a treat and I&#039;ll forgive you if you can tell me..WHY WON"T IT WORK FOR ANOTHER PAGE..eek!!!!<BR><BR>strDeleteHref = "javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;" & Replace(Location, "&#039;", "&#039;") & "/" & Replace(NTDomain, "&#039;", "&#039;") & "&#039;?&#039;))" & _<BR>"location.href=&#039;nt_location.asp?location =" & Server.urlEncode(Location) &"& ntdomain=" & Server.urlEncode(NTDomain)&"&form_action=DELETE&#0 39;;return false;"<BR> <BR> <BR><BR>Response.write "&#060;td class=""tblInfo""&#062;&#060;a href=""" & strEditHref & """&#062;&#060;image src=""../images/edit.gif"" border=0 alt=""Edit""&#062;&#060;/a&#062;&#060;a href=""#"" onclick=""" & strDeleteHref & """&#062;&#060;image src=""../images/delete.gif"" border=0 alt=""Delete""&#062;&#060;/a&#062;&#060;/td&#062;"<BR><BR><BR>When I view the source its as follows:<BR> <BR> &#060;tr&#062;&#060;td&#062;&#060;table border="0" width="100%" cellspacing="1" cellpadding="0"&#062;&#060;tr&#062;&#060;td class="tblHeader" nowrap&#062;Action&#060;/td&#062;&#060;td class="tblHeader" nowrap&#062;NT Domain&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td class="tblInfo"&#062;&#060;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL&type=EDIT"&#062;&#060;image src="../images/edit.gif" border=0 alt="Edit"&#062;&#060;/a&#062;&#060;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;))location.href=&#039;nt_locat ion.asp?location=CAROL%27S+TEST& ntdomain=CAPITAL&form_action=DELETE&#039;;return false;"&#062;&#060;image src="../images/delete.gif" border=0 alt="Delete"&#062;&#060;/a&#062;&#060;/td&#062;&#060;td class="tblInfo"&#062;CAPITAL&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td class="tblInfo"&#062;&#060;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL%28TEST%29&type=EDIT"&#062;&#060;imag e src="../images/edit.gif" border=0 alt="Edit"&#062;&#060;/a&#062;&#060;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL(TEST)&#039;?&#039;))location.href=&#039;nt _location.asp?location=CAROL%27S+TEST& ntdomain=CAPITAL%28TEST%29&form_action=DELETE&#039 ;;return false;"&#062;&#060;image src="../images/delete.gif" border=0 alt="Delete"&#062;&#060;/a&#062;&#060;/td&#062;&#060;td class="tblInfo"&#062;CAPITAL(TEST)&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td class="tblInfo"&#062;&#060;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=DCC&type=EDIT"&#062;&#060;image src="../images/edit.gif" border=0 alt="Edit"&#062;&#060;/a&#062;&#060;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/DCC&#039;?&#039;))location.href=&#039;nt_location. asp?location=CAROL%27S+TEST& ntdomain=DCC&form_action=DELETE&#039;;return false;"&#062;&#060;image src="../images/delete.gif" border=0 alt="Delete"&#062;&#060;/a&#062;&#060;/td&#062;&#060;td class="tblInfo"&#062;DCC&#060;/td&#062;&#060;/tr&#062;<BR>&#060;/table&#062;<BR>&#060;/td&#062;&#060;/tr&#062;<BR><BR><BR>It is not throwing back an error this time... its simply not redirecting at all..it just pops up the warning and on pressing ok it does nothing<BR><BR>Thanks for all the help

  8. #8
    Join Date
    Dec 1969
    Posts
    96,118

    Default Which one of those...

    ...isn&#039;t working???<BR><BR>Can you take the HTML, break it into logical "chunks", and then point out which one(s) isn&#039;t (aren&#039;t?) working? And which ones are working, for that matter!<BR><BR>Tell, you what. Here that same HTML is, all prettied up. Point out the ones that work and the ones that don&#039;t:<BR><BR>******************************* **<BR><BR>&lt;tr&#062;<BR>&nbsp; &nbsp; &lt;td&#062;<BR>&nbsp; &nbsp; &lt;table border="0" width="100%" cellspacing="1" cellpadding="0"&#062;<BR>&nbsp; &nbsp; &lt;tr&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblHeader" nowrap&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Action<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblHeader" nowrap&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NT Domain<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &lt;/tr&#062;<BR>&nbsp; &nbsp; &lt;tr&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL&type=EDIT"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/edit.gif" border=0 alt="Edit"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;))location.href=&#039;nt_locat ion.asp?location=CAROL%27S+TEST& ntdomain=CAPITAL&form_action=DELETE&#039;;return false;"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CAPITAL<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &lt;/tr&#062;<BR>&nbsp; &nbsp; &lt;tr&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=CAPITAL%28TEST%29&type=EDIT"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/edit.gif" border=0 alt="Edit"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL(TEST)&#039;?&#039;))location.href=&#039;nt _location.asp?location=CAROL%27S+TEST& ntdomain=CAPITAL%28TEST%29&form_action=DELETE&#039 ;;return false;"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CAPITAL(TEST)<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &lt;/tr&#062;<BR>&nbsp; &nbsp; &lt;tr&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=DCC&type=EDIT"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/edit.gif" border=0 alt="Edit"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/DCC&#039;?&#039;))location.href=&#039;nt_location. asp?location=CAROL%27S+TEST& ntdomain=DCC&form_action=DELETE&#039;;return false;"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DCC<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &lt;/tr&#062;<BR>&nbsp; &nbsp; &lt;/table&#062;<BR>&nbsp; &nbsp; &lt;/td&#062;<BR>&lt;/tr&#062;<BR>

  9. #9
    Join Date
    Dec 1969
    Posts
    144

    Default RE: Which one of those...

    Any of the delete links....e.g.<BR><BR><BR>&#060;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL&#039;?&#039;))location.href=&#039;nt_locat ion.asp?location=CAROL%27S+TEST& ntdomain=CAPITAL&form_action=DELETE&#039;;return false;"&#062; <BR>&#060;image src="../images/delete.gif" border=0 alt="Delete"&#062; <BR> &#060;/a&#062; <BR> &#060;/td&#062; <BR> &#060;td class="tblInfo"&#062; <BR> CAPITAL <BR> &#060;/td&#062; <BR> &#060;/tr&#062; <BR> <BR>OR<BR>&#060;tr&#062; <BR>&#060;td class="tblInfo"&#062; <BR>&#060;a href="#" onclick="javascript:if (confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/CAPITAL(TEST)&#039;?&#039;))location.href=&#039;nt _location.asp?location=CAROL%27S+TEST& ntdomain=CAPITAL%28TEST%29&form_action=DELETE&#039 ;;return false;"&#062; <BR> &#060;image src="../images/delete.gif" border=0 alt="Delete"&#062; <BR><BR><BR>The warning appears but on clicking ok nothing happens<BR><BR>I appreciate this

  10. #10
    Join Date
    Dec 1969
    Posts
    96,118

    Default Worked for me...

    Dunno what to say.<BR><BR>I simply wrapped all that stuff that I had reformatted with &#060;HTML&#062;&#060;BODY&#062;&#060;TABLE&#06 2; and &#060;/TABLE&#062;&#060;/BODY&#062;&#060;/HTML&#062; and it worked perfectly! All 3 of them.<BR><BR>I do have an idea for an alternative way of doing this, though, that might simplify your life a *lot*.<BR><BR>Try this:<BR><BR>********************************<BR>< BR>&nbsp; &nbsp; &lt;tr&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=DCC&type=EDIT"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/edit.gif" border=0 alt="Edit"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href="nt_location.asp?location=CAROL%27S+TEST&nt_d omain=DCC&type=DELETE"<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onclick="return confirm(&#039;Warning: Are you sure that you want to delete NT Location/Domain &#039;CAROL&#039;S TEST/DCC&#039;?&#039;);"<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image src="../images/delete.gif" border=0 alt="Delete"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/a&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class="tblInfo"&#062;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DCC<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&#062;<BR>&nbsp; &nbsp; &lt;/tr&#062;<BR><BR>******************************<BR> <BR>See the trick? We go ahead an set up the HREF=URL just exactly the same way you would for the EDIT. But then we add in the onClick that does a call to the confirm. And since confirm returns true/false, just as we want, we just have the onClick return *that* value. <BR><BR>If the confirm returns false, onClick returns false, and the HREF= is *NOT* done!<BR><BR>If the confirm returns true, onClick returns true, and off we go to the URL!<BR><BR>

Posting Permissions

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