Javascript problems in FireFox

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
trent2800
Forum Commoner
Posts: 48
Joined: Mon Oct 02, 2006 7:02 am

Javascript problems in FireFox

Post by trent2800 »

Strangely enough, this works in IE but not in Firefox... I cant figure it out.

Code: Select all

//This is the function that sets the times for the milestone timestamp text fields.

	function SetTime(NodeName){
	
		var MyNode = document.getElementById(NodeName);
		MyNode.value = CustomTime();
		MyNode.disabled = 0;
		MyNode.tabIndex = 0;
	
	}

Code: Select all

//This is a function that creates a time format that matches the HPSD format.
	function CustomTime(){
	
		var currentDate = new Date();
		var day = currentDate.getDate();
		var month = currentDate.getMonth() +1;
		var year = currentDate.getFullYear();
		var minute = currentDate.getMinutes();
		var hour = currentDate.getHours();
		
		if(day<10){day = "0" + day}
		
		if(month<10){month = "0" + month}
		
		if(minute<10){minute = "0" + minute}
		
		if(hour<10){minute = "0" + hour}
		
		return(month + "/" + day + "/" + year + " " + hour + ":" + minute);
	
	}

Code: Select all

<body onLoad=MyToolTips()<% If request.querystring("TicketID") = "" Then response.Write(";SetTime('InvestigateStart')") End If%>>

<tr>
 <td>
  <div align="center">
    <input type="text" name="InvestigateStart" disabled="True" tabindex="-1">
    </div>
 </td>
</tr>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Quotes missing? Malformed HTML?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Install Firebug.
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

onion2k wrote:Install Firebug.
I second that! hooray FireBug!
garry27
Forum Commoner
Posts: 90
Joined: Sat Oct 14, 2006 1:50 pm

Post by garry27 »

there's a decent video tutorial for firebug at: http://www.digitalmediaminute.com/scree ... irebug-js/ if anyone's interested.
Post Reply