Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
Selectbox undefined on FIREFOX when passed to the next page

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> General discussion
View previous topic :: View next topic  
Author Message
lvb
New one
New one


Joined: 25 Sep 2006
Posts: 2

PostPosted: Mon Sep 25, 2006 10:19 pm    Post subject: Selectbox undefined on FIREFOX when passed to the next page Reply with quote

Hello,
I am using Coldfusion and Ajax to populate a selectbox then pass the value to the next page. It works just fine on IE. On FireFox, it gives error saying 'form.thevalue' undefined. Can I pass the value populated through Ajax to the next page? Please see the Ajax function below:

GetTime.js
var oXmlHttp

function showTime(staff, date, available)
{
var url="/cf/misc/GetTime.cfm?nicknm=" + staff + "&dt=" + date + "&ti=" + available
oXmlHttp=GetHttpObject(stateChanged)
oXmlHttp.open("GET", url , true)
oXmlHttp.send(null)
}

function stateChanged()
{
if (oXmlHttp.readyState==4 || oXmlHttp.readyState=="complete")
{
document.getElementById("TimeList").innerHTML=oXmlHttp.responseText
}
}

function GetHttpObject(handler)
{
try
{
var oRequester = new XMLHttpRequest();
oRequester.onload=handler
oRequester.onerror=handler
return oRequester
}
catch (error)
{
try
{
var oRequester = new ActiveXObject("Microsoft.XMLHTTP");
oRequester.onreadystatechange=handler
return oRequester
}
catch (error)
{
return false;
}
}
}

Thanks much in advance.
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Thu Sep 28, 2006 11:44 am    Post subject: Reply with quote

Don't see the error anywhere, have you a running example of this code?
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
lvb
New one
New one


Joined: 25 Sep 2006
Posts: 2

PostPosted: Thu Sep 28, 2006 5:16 pm    Post subject: Reply with quote

Thank you Snyke for replying.
I am using ColdFusion. I probably need to post my ColdFusion files too. Here's part of the form.cfm and GetTime.cfm:

form.cfm
<tr><td align=right nowrap="nowrap">Signature Staff: &nbsp;</td>
<td><select name="select_employee" id="select_employee" onchange="showTime(this.value,
document.apptform.appointment_date.value, '');">
<option value="All">All</option>
<cfloop query = "GetEmployees">
<cfif GetEmployees.EMPLOYEE_ID eq '#chg_select_employee#'>
<cfset select = "SELECTED">
<cfelse>
<cfset select = "">
</cfif>
<cfoutput><option value="#GetEmployees.EMPLOYEE_ID#"
#select#>#GetEmployees.NICK_NAME#</option></cfoutput>
</cfloop>
</select></td>
<td align=right>Select Date: &nbsp;</td>
<td><select name="appointment_date" id="appointment_date"
onchange="showTime(document.apptform.select_employee.value, this.value, '');">
<option value=''>[Select]</option>
<cfloop list="#datelist#" index="thedate">
<cfif thedate eq '#chg_appointment_date#'>
<cfset select='SELECTED'>
<cfelse>
<cfset select=''>
</cfif>
<cfoutput><option value="#thedate#" #select#>#thedate#</option></cfoutput>
</cfloop>
</select></td>
</tr>
<tr><td align=right valign=top>Available Time: &nbsp;</td>
<td valign=top><span id="TimeList">
<select name="available_time">
<option value=""></option>
</select></span></td>


GetTime.cfm
<CFINCLUDE TEMPLATE="include.cfm">
<cfset timelist = arrayToList(structSort(atime, "numeric"))>
<cfset timelist1 = arrayToList(structSort(atime1, "numeric"))>

<span>
<select name="available_time">

<cfif trim(URL.nicknm) eq 'All'>
<option value=''>[Select]</option>
<cfloop list='#timelist#' index='time'>
<cfif time EQ '#trim(url.ti)#'>
<cfset select = 'SELECTED'>
<cfelse>
<cfset select = ''>
</cfif>
<cfoutput><option value="#atime[time]#" #select#>#time#</option></cfoutput>
</cfloop>
<cfelse>
<cfquery name="getEmployee" datasource="signatu_datasource" cachedwithin="#createTimeSpan(0,0,0,-1)#">
select * from SIGNATU_APPOINTMENT
where EMPLOYEE_ID = "#trim(URL.nicknm)#"
and DATE = "#trim(URL.dt)#"
</cfquery>

<cfset tempTimeList = ValueList(getEmployee.TIME)>
<cfif getEmployee.RecordCount GT 0>
<option value=''>[Select]</option>
<cfloop list="#tempTimeList#" index="theTime">
<cfloop list='#timelist1#' index='current_time'>
<cfif current_time eq '#theTime#'>
<cfset d = StructDelete(atime1, "#current_time#", "True")>
</cfif>
</cfloop>
</cfloop>

<cfset timelist2 = arrayToList(structSort(atime1, "numeric"))>
<cfloop list='#timelist2#' index='time2'>
<cfif time2 EQ '#trim(url.ti)#'>
<cfset select = 'SELECTED'>
<cfelse>
<cfset select = ''>
</cfif>
<cfoutput><option value="#atime1[time2]#" #select#>#time2#</option></cfoutput>
</cfloop>
<cfelse>
<option value=''>[Select]</option>
<cfloop list='#timelist1#' index='curr_time'>
<cfif curr_time EQ '#trim(url.ti)#'>
<cfset select = 'SELECTED'>
<cfelse>
<cfset select = ''>
</cfif>
<cfoutput><option value="#atime1[curr_time]#" #select#>#curr_time#</option></cfoutput>
</cfloop>
</cfif>
</cfif>
</select>
</span>

When I pass #form.available_time# to the next page, I got error on FireFox, 'form.available_time' undefined.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> General discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert