Link to home
Start Free TrialLog in
Avatar of djb80
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.html;","Select 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("OutString").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(this.value);" value="View Form" > 
<input type="button" name="Choice" onClick="return_function(this.value);" value="Update Form">
<input type="button" name="Choice" onClick="return_function(this.value);" value="Delete Form">
</form>




</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of 0h4crying0utloud
0h4crying0utloud

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial