tech_abby*
10-21-2004, 06:56 AM
I have a phone book with a list of numbers, and near each number there is a radio button. The phone number selected (radio button will be clicked), needs to be inserted in a text field in another page. How do I get around with this?
The following part shows the code written so far:
(Phonebook.asp):
sub window_onload()
end sub
Sub ReturnMe(objMe)
window.returnvalue = document.getElementbyID("RadioGroup1").value
window.close
end sub
<form name="form1" method="post">
<table width="200">
<tr><td><label>
<input type="radio" name="RadioGroup1" value="something" onClick="ReturnMe(objMe)">
something
</label></td></tr>
<tr><td><label>
<input type="radio" name="RadioGroup1" value="otherthing" onClick="ReturnMe(objMe)">
other thing
</label></td></tr>
</table>
</form>
(main page.asp):
sub window_onload()
end sub
Sub GetPhone(objMe)
strThisElement = objMe.getattribute("IndexVal")
//retVal = window.showModalDialog ("../../MizziCalendar/calDraw1.asp?Locale=Set",,"dialogWidth:248px;dialogHeight:225px;status: no;unadorned: yes;help: no;scroll:no")
retVal = window.showModalDialog ("PhoneBook.asp",,"dialogWidth:248px;dialogHeight:225px;status: no;unadorned: yes;help: no;scroll:no")
If retVal <> "" Then
document.all(strThisElement).value = retVal
End If
End Sub
<input name="txtEntryDate" value="" type="text" id="txtEntryDate">
<img src="phonebook_icon.gif" name="ChoosePhone" width="41" height="27" hspace="5" vspace="0" align="absmiddle" id="ChoosePhone" onClick="vbscript:CALL GetPhone(Me)" indexval="txtEntryDate">
</form>
I do not know how to return the value of a particular element of the radiogroup into the textbox (in another page). :confused:
The following part shows the code written so far:
(Phonebook.asp):
sub window_onload()
end sub
Sub ReturnMe(objMe)
window.returnvalue = document.getElementbyID("RadioGroup1").value
window.close
end sub
<form name="form1" method="post">
<table width="200">
<tr><td><label>
<input type="radio" name="RadioGroup1" value="something" onClick="ReturnMe(objMe)">
something
</label></td></tr>
<tr><td><label>
<input type="radio" name="RadioGroup1" value="otherthing" onClick="ReturnMe(objMe)">
other thing
</label></td></tr>
</table>
</form>
(main page.asp):
sub window_onload()
end sub
Sub GetPhone(objMe)
strThisElement = objMe.getattribute("IndexVal")
//retVal = window.showModalDialog ("../../MizziCalendar/calDraw1.asp?Locale=Set",,"dialogWidth:248px;dialogHeight:225px;status: no;unadorned: yes;help: no;scroll:no")
retVal = window.showModalDialog ("PhoneBook.asp",,"dialogWidth:248px;dialogHeight:225px;status: no;unadorned: yes;help: no;scroll:no")
If retVal <> "" Then
document.all(strThisElement).value = retVal
End If
End Sub
<input name="txtEntryDate" value="" type="text" id="txtEntryDate">
<img src="phonebook_icon.gif" name="ChoosePhone" width="41" height="27" hspace="5" vspace="0" align="absmiddle" id="ChoosePhone" onClick="vbscript:CALL GetPhone(Me)" indexval="txtEntryDate">
</form>
I do not know how to return the value of a particular element of the radiogroup into the textbox (in another page). :confused:
