Skip to main content
Inspiring
August 31, 2010
Question

Issues with coldfusion.navigate (CF9) in Safari & Chrome

  • August 31, 2010
  • 1 reply
  • 1525 views

I am using Coldfusion 9. I have a ColdFusion.navigate call in a cfdiv tag located within a Cflayout tag (type tab).

The following piece of code is located in a file called "inc_shjobs.cfm" and is being called using the src attribute from a Cflayout tag on another page:

<script>
        ColdFusion.navigate('inc_shjobs.cfm?morejobs','jobs1')
  </script>


<cfdiv id="jobs1">
<form name="ne">   
    <table width="98%" cellspacing="1" cellpadding="6" border="0" bgcolor="white" >
      <tr>
        <td colspan="1" align="center"><br />
       
<input type="submit" name="morejobs" style="font-size:1.4em; font-style:bold " value="Expand Job Search" onClick="javaScript:ColdFusion.navigate('inc_shjobs.cfm?morejobs','jobs1');    "></td>
      </tr>
  </tr>
        
  <tr><td><br /><br /></td></tr>
       <tr><td valign="top">
             <strong>Search Within</strong> <select name="radius" >
      <option value="0" <cfif session.trn.jsradius is 0> selected</cfif>>0 miles</option>
      <option value="5" <cfif session.trn.jsradius is 5> selected</cfif>>5 miles</option>     
      <option value="10" <cfif session.trn.jsradius is 10> selected</cfif>>10 miles</option>           
      <option value="25" <cfif session.trn.jsradius is 25> selected</cfif>>25 miles</option>                 
      <option value="50" <cfif session.trn.jsradius is 50> selected</cfif>>50 miles</option>                 
      <option value="100" <cfif session.trn.jsradius is 100> selected</cfif>>100 miles</option>                 
      <option value="-1" <cfif session.trn.jsradius is -1> selected</cfif>>Statewide</option>                 
      <option value="-2" <cfif session.trn.jsradius is -2> selected</cfif>>Nationally</option>                 
      </select>
    <input type="submit" name="rad" value="Go" onClick="javaScript:ColdFusion.navigate('inc_shjobs.cfm?radius='+ne1.radius.options[radius.selectedIndex].value,'jobs1')">  center of  <strong><cfoutput>#session.trn.city#</cfoutput></strong></td>
     
<td  valign="top"><a href="dsp_jobresearch.cfm" ><img src="images/justjobs1.gif" alt="Just Job Search" border="0" /> </a></td>
         </tr>
    </table>
    </form>
    </cfdiv>

In IE and FF, it behaves approriately by loading only the div. In Chrome and Safary, it reloads the entire page and ignores the parameters. When the same code was run under CF8, it also worked.

Anyone got a clue as to why?

Thanks!

    This topic has been closed for replies.

    1 reply

    August 31, 2010

    I just tested ColdFusion.navigate on Safari and Chrome (Win 7) and everything works fine.

    I recently ran into that same behavior and it had to do with submitting a form. I set an onSuccess or an onSubmit javascript function, which caused an exception and IE didn't handle it very well. It reloaded the entire page.

    I suspect it has to do with a javascript error. I would start by doing some simple js debugging.

    KDN0211Author
    Inspiring
    September 2, 2010

    Thanks for your reply. Much appreciated! 

    Firebug reports no errors, neither does cfdebug. But when I changed the <input type="submit"> to <input type="button"> it worked!!!! Thanks for the hint!