Hi,
I have a javascript function that uses ajax to set a div based on a query.
The javascript function is invoked on a button click and uses ajax like this:
[CODE=javascript]function validDate(node, roomid)
{
var allparams= 'timechk=' + params +'&starttime=' +params1 +'&endtime=' + params2 +'&roomid=' + params3 +'&ckres=' + params4
var ajax = new Ajax.Updater(
{success:ck_res },
url,
{method: 'get', parameters:allp arams, onFailure: reportError});
}
}
[/CODE]ck_res is the div whose innerhtml should be set
this is the ajax function that sets the div
[CODE=cfm]<cfif NOT IsDefined("url. timechk")>
<div >Please enter a valid date.</div><cfabort>
</cfif>
<cfquery datasource="#ap plication.datas ource#" name="datelooku p">
SELECT ---------
</cfquery>
<cfif datelookup.reco rdcount>
<div ><cfoutput>Th is date is booked.</cfoutput></div>
<cfelse>
<div >This date is free.</div>
</cfif>
[/CODE]I have a save button on my form.And i want it disabled until the div is set as "This date is free".How do I do that?
I have a javascript function that uses ajax to set a div based on a query.
The javascript function is invoked on a button click and uses ajax like this:
[CODE=javascript]function validDate(node, roomid)
{
var allparams= 'timechk=' + params +'&starttime=' +params1 +'&endtime=' + params2 +'&roomid=' + params3 +'&ckres=' + params4
var ajax = new Ajax.Updater(
{success:ck_res },
url,
{method: 'get', parameters:allp arams, onFailure: reportError});
}
}
[/CODE]ck_res is the div whose innerhtml should be set
this is the ajax function that sets the div
[CODE=cfm]<cfif NOT IsDefined("url. timechk")>
<div >Please enter a valid date.</div><cfabort>
</cfif>
<cfquery datasource="#ap plication.datas ource#" name="datelooku p">
SELECT ---------
</cfquery>
<cfif datelookup.reco rdcount>
<div ><cfoutput>Th is date is booked.</cfoutput></div>
<cfelse>
<div >This date is free.</div>
</cfif>
[/CODE]I have a save button on my form.And i want it disabled until the div is set as "This date is free".How do I do that?
Comment