www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21

Thread: Adding quote to server side variable

  1. #16
    Join Date
    Nov 2010
    Posts
    1,036
    I get it. How about we turn it into a string straight off?

    Code:
    <script type="text/javascript"> 
    var myvar='"'+<%=dspLayoutName%>+'"'; //I  don't know if you need the + signs here if you are echoing in from ASP
    if(myvar!=""){ //or if(myvar)
    alert(myvar)
    formFloorPlan.cloneof.value=fixQuotes(myvar);
    }
    </script>

  2. #17
    Join Date
    Jun 2012
    Posts
    58
    Ok, I tried it with and without the + signs and got the same result.

    Error code:
    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Fri, 5 Oct 2012 14:39:57 UTC


    Message: Expected ';'
    Line: 519
    Char: 14
    Code: 0
    URI: http://houapptst07/floorplan/FloorMgr_Cleaned.asp

    Here is the code that is rendered:
    Code:
    function onCloneFloorObjects()
    {
      if(!assertLayoutLoaded()) return false;
    LINE 519 BELOW  
    var myvar='"''"'; //I  don't know if you need the + signs here if you are echoing in from ASP
    if(myvar!=""){ //or if(myvar)
    alert(myvar)
    formFloorPlan.cloneof.value=fixQuotes(myvar);
    }
     
      window.open("Clone.asp",'EditHTML','width=430,height=200,scrollbars=no');
    }
    Thanks again for your time.

  3. #18
    Join Date
    Nov 2010
    Posts
    1,036
    I think we're getting closer...
    Code:
    <script type="text/javascript"> 
    var myvar="<%=dspLayoutName%>";
    if(myvar!=""){ //or if(myvar)
    alert(myvar)
    formFloorPlan.cloneof.value=fixQuotes(myvar);
    }
    </script>

  4. #19
    Join Date
    Jun 2012
    Posts
    58
    That did it!! Thank you so much for your help and time.

  5. #20
    Join Date
    Nov 2010
    Posts
    1,036
    Phew! I'm going back to bed...

  6. #21
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,264
    Try this
    Code:
    <script type="text/javascript"> 
    var myvar="<%=dspLayoutName%>";
    if(myvar){ //or if(myvar!="")
    formFloorPlan.cloneof.value=fixQuotes(myvar);
    }
    </script>
    EDIT : Sorry , I had not seen the second page
    Last edited by 007Julien; 10-06-2012 at 07:11 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles