djb80
asked on
passing variables module dialog
I need to save a return variable from javascript as a hidden form field.
Save the following as question.cfm
<script type="text/javascript">
function OpenModalDialog()
{
var ReturnedValue = showModalDialog("Modal.htm l;","Selec t One",
"dialogWidth:400px; dialogHeight:225px; status:no; center:yes");
alert("Modal Dialog returned " + ReturnedValue);
}
</script>
<cfform>
<input type="radio" value=" Open Modal Dialog" onclick="OpenModalDialog() "/>CHOOSE
</cfform>
<cfoutput>I want to be able to have the ReturnedValue
from the module dialog be a hidden field when I submit the
form</cfoutput>
************************** ********** *********8
Save this as module.html
<script type="text/javascript">
function GetPassedValue()
{
var PassedString = window.dialogArguments;
document.getElementById("O utString") .innerText = PassedString;
}
function return_function(choice)
{
returnValue = choice;
window.close();
}
</script>
<html>
<body onload="GetPassedValue()">
<span id="OutString"></span>.
<br>
<cfoutput>I want to have a value passed in
that will be able to determine whether all or just
two of these button will be shown</cfoutput>
<form name="ask">
<input name="Choice" type="button" onClick="return_function(t his.value) ;" value="View Form" >
<input type="button" name="Choice" onClick="return_function(t his.value) ;" value="Update Form">
<input type="button" name="Choice" onClick="return_function(t his.value) ;" value="Delete Form">
</form>
</body>
</html>
Save the following as question.cfm
<script type="text/javascript">
function OpenModalDialog()
{
var ReturnedValue = showModalDialog("Modal.htm
"dialogWidth:400px; dialogHeight:225px; status:no; center:yes");
alert("Modal Dialog returned " + ReturnedValue);
}
</script>
<cfform>
<input type="radio" value=" Open Modal Dialog" onclick="OpenModalDialog()
</cfform>
<cfoutput>I want to be able to have the ReturnedValue
from the module dialog be a hidden field when I submit the
form</cfoutput>
**************************
Save this as module.html
<script type="text/javascript">
function GetPassedValue()
{
var PassedString = window.dialogArguments;
document.getElementById("O
}
function return_function(choice)
{
returnValue = choice;
window.close();
}
</script>
<html>
<body onload="GetPassedValue()">
<span id="OutString"></span>.
<br>
<cfoutput>I want to have a value passed in
that will be able to determine whether all or just
two of these button will be shown</cfoutput>
<form name="ask">
<input name="Choice" type="button" onClick="return_function(t
<input type="button" name="Choice" onClick="return_function(t
<input type="button" name="Choice" onClick="return_function(t
</form>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.