<input name="theName" type="text" class="medTField">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Save the file in the Configuration/Commands folder as MyDatasource_Variable.htm.
Then, as shown in the following example, the supporting JavaScript file simply determines the
buttons for the dialog box and how to assign the user input from the dialog box:
//******************* API **********************
function commandButtons(){
return new Array(MM.BTN_OK,"okClicked()",MM.BTN_Cancel,"window.close()");
}
//***************** LOCAL FUNCTIONS
function okClicked(){
var nameObj = document.forms[0].theName;
if (nameObj.value) {
if (IsValidVarName(nameObj.value)) {
MM.MyDatasourceContents = nameObj.value;
MM.retVal = "OK";
window.close();
} else {
alert(nameObj.value + " " + MM.MSG_InvalidParamName);
}
} else {
alert(MM.MSG_NoName);
}
}
Save this JavaScript file in the Configuration/Commands folder as MyDatasource_Variable.js.
Using the new data source
You can now open Dreamweaver (or restart it if you already have it open), and open a ColdFusion
file or create a new one.
304
Chapter 16: Data Sources
******************
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers