#1
  1. No Profile Picture
    The one who gets it done
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Madison, WI
    Posts
    395
    Rep Power
    14

    New NN Suckiness - um, JavaScript?


    OK, new problem with NetScape. I have many links that call javascript functions. Here's one example:
    Code:
    <a href="javascript:fnIndSubmit('LocInd39','','Add');"
    title="Add individual registration to this location"
    onmousemove="javascript:window.status='Add individual registration to this location';"
    onmouseout="javascript:window.status='';">
    <img src="images\addinds.gif" border="0" align="absmiddle" vspace="2" WIDTH="41" HEIGHT="29"></a>
    (note: the word j..s... is being split into two parts - by this site...)

    And here's the code it's calling (in red - I'm throwing in the whole script block, just in case...). You'll note, I'm sure, that in the link above I'm not sending an intINDID - this is because I'm adding a new individual, so there isn't one yet...:
    Code:
    <script language="JavaScript">	
    	function fnCompanySubmit()
    	{
    		document.Company.submit();
    	}
    	function fnLocSubmit(strForm,intLOCID,strFormModeToPass)
    	{
    		document.forms(strForm).BCMCLOCID.value = intLOCID;
    		document.forms(strForm).FormModeToPass.value = strFormModeToPass;
    		document.forms(strForm).submit();
    	}
    	function fnIndSubmit(strForm,intINDID,strFormModeToPass)
    	{
    		document.forms(strForm).BCMCINDID.value = intINDID;
    		document.forms(strForm).FormMode.value = strFormModeToPass;
    		document.forms(strForm).submit();
    	}
    	function fnJumpToLocBookmark()
    	{
    		var LOCID = document.frmLocations.LocationsEntered.value;
    		window.location.href = "#Loc" + LOCID;
    	}
    	function fnJumpToIndBookmark()
    	{
    		var INDID = document.frmIndividuals.IndividualsEntered.value;
    		window.location.href = "#Ind" + INDID;
    	}
    	function fnIndSort(strSortBy,intLOCID)
    	{//<A> passes in string to sort. Make a cookie. Cookie read when page loads.
    		
    		var strCookie = getCookieValue("IndSortBy");
    			//alert("cookie is '" + strCookie + "' and passed is '" + strSortBy +"'");		
    		if (strSortBy == strCookie)
    		{	
    			//alert("it is equal");
    			strSortBy = strSortBy + " DESC";
    		}
    
    		document.cookie = "IndSortBy=" + escape(strSortBy);
    		document.forms("LocInd" + intLOCID).action="bcmcregreview.asp#LocInd" + intLOCID;
    		document.forms("LocInd" + intLOCID).submit();
    	}
    </script>
    Whoa! NN just crashed! IE doesn't do that!

    I've tried taking the 'javascript' out of the link, taking out the semi-colon, putting it in the onclick event (needs an href - so I added href="", which didn't work...).

    I'm sure one of you fine folks can help me out. It'd be greatly appreciated.

    Jay
    Last edited by Jay Edgar; June 28th, 2001 at 05:56 PM.
  2. #2
  3. No Profile Picture
    The one who gets it done
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Madison, WI
    Posts
    395
    Rep Power
    14
    oops - hit quote, not edit. -J
    Last edited by Jay Edgar; June 28th, 2001 at 05:57 PM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Dublin
    Posts
    413
    Rep Power
    14
    What about
    Code:
    <a href=# onclick="fnIndSubmit('LocInd39','','Add');return false;" title="Add individual registration to this location"
    onmousemove="window.status='Add individual registration to this location';return true;"
    onmouseout="window.status='';return true;">
    Does that still crash??
    (I haven't tried your code / don't know what's crashing your Netscape.)
  6. #4
  7. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    Jay Edgar (Hoover?) -

    IE supports referencing array elements within [] or () - Netscape requires Javascript/ECMA syntax (only the square bracket operators). document.forms is an array (collection) so, code accordingly. If the form has a name property set in HTML, you can retrieve a (cross-browser) reference to it at

    document.formname (alternately document[formname] if you're passing the name as a string argument).
  8. #5
  9. No Profile Picture
    The one who gets it done
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Madison, WI
    Posts
    395
    Rep Power
    14

    Smile


    Adios, you are brilliant. That did the trick. Thank you also, epl, for your response.

    I knew I could count on someone in here. Very much obliged!

    Jay

    PS: Adios, you are the first person to ever think of 'hoover'; how clever of you
  10. #6
  11. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    UW grad, natch....

IMN logo majestic logo threadwatch logo seochat tools logo