Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question single quote problem

    hi,

    I am using a pop up window to populate parent window controls.

    In the pop up window i have provided a link. if user clicks that link it will populate the parent window.

    if the link has any single quote like eg: " san's test " it is not populating and does nothing

    please help me

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    (edited)
    Last edited by Bill Posters; 05-23-2005 at 12:44 PM.

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question single quote problem

    how to encode please help

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    (edited)
    Last edited by Bill Posters; 05-23-2005 at 12:44 PM.

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You must escape it by using \'

    <a href="#" onclick="theFunc('san\'s test');return false;">link</a>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    single quote problem

    htp.p('<td valign=top><input type=hidden name="'||prog_srch_cur.prog_title||'" value="'||prog_srch_cur.program_id||'">');
    htp.p('<a href="#" onclick="opener.document.getElementById(''retprogram'').value='''||prog_srch_cur.prog_title||''';
    opener.document.getElementById(''retmodule'').value='''';
    opener.document.getElementById(''retprogramtype'').value='''||prog_srch_cur.prog_type||''';
    opener.document.getElementById(''rettrainingtype'').value=''Managers and Associates'';
    opener.document.getElementById(''retstartdate'').value='''||to_char(prog_srch_cur.prog_start_date,'m m/dd/yyyy')||''';
    opener.document.getElementById(''retenddate'').value='''||to_char(prog_srch_cur.prog_end_date,'mm/dd/yyyy')||''';
    window.close()" class=resultlink>'||prog_srch_cur.prog_title||'</a></td>');
    htp.p('<td valign=top class=clientpreview>&nbsp;'||prog_srch_cur.prog_type||'</td>');
    htp.p('<td>&nbsp;</td>');

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    What are these characters '|| ||'
    Are they server-side code delimiters?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    If those indeed are server-side delimiters, then this is how I'd fix it.
    You can simplify it and make it less confusing by making a function.

    Code:
    function setValues(prog, module, progType, trainingType, startDate, endDate){
      if (opener && !opener.closed){ //check if opener is still open
         var docId = opener.document.getElementById;
         docId('retprogram').value = prog;
         docId('retmodule').value = module;
         docId('retprogramtype').value = progType;
         docId('rettrainingtype').value = trainingType;
         docId('retstartdate').value = startDate;
         docId('retenddate').value = endDate;     
      }
      window.close();
      return false; //cancel href default action
    }
    ...
    htp.p('<td valign="top"><input type="hidden" name="'||prog_srch_cur.prog_title||'" value="'||prog_srch_cur.program_id||'">');
    htp.p('<a href="#" onclick="return setValues(\''||prog_srch_cur.prog_title||'\', \'\', \''||prog_srch_cur.prog_type||'\', \'Managers and Associates\', \''||to_char(prog_srch_cur.prog_start_date,'m m/dd/yyyy')||'\', \''||to_char(prog_srch_cur.prog_end_date,'mm/dd/yyyy')||'\');" class="resultlink">'||prog_srch_cur.prog_title||'</a></td>');
    htp.p('<td valign="top" class="clientpreview">&nbsp;'||prog_srch_cur.prog_type||'</td>');
    htp.p('<td>&nbsp;</td>');
    Just make sure that those server-side scripts must replace all occurrences of single qoutes (if any) in the values to \'
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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