SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Threaded View
-
Sep 4, 2013, 04:03 #1
- Join Date
- Sep 2013
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Classic ASP Passing data from child page to parent page
i have a classic asp webpage
and i need to populate a textbox value on a parent page from a chaild page that pops up
so on the parent page i have a link in javascript that opens a new popup window WHILE retaining focus on the textbox
<input type="text" class="field_required2"
name="sEcode"
size="15"
value="<%=sEcode %>"
onBlur="validateEcode(this.value);" onFocus="setBGColor(this);" >
<a onClick="searchEcodeFunc();"><img src="img/next.gif" border="0"></a>
The on click will run java script and open a popup window
<script language="javascript">
function searchEcodeFunc() {
document.forms.submitter.sEcode.focus();
window.open('ecodeSearch.asp?ecodestr', null, 'height=400,width=500,status=yes,toolbar=no,m enubar=no,location=no'); }
</script>
on the popup page an asp function will populate a variable and session variable with my data call it session("ecode")
i need to send this session variable or a variable to the parent page textbox that is in focus
the only way i have so far is via session variables
on the parent page i have a further javascript that is called by the
onBlur="validateEcode(this.value);" of the textbox
the javascript it runs is
function validateEcode(myVal) {
var textbox = document.getElementsByName('sEcode')[0]
textbox.value ='<%=session("Ecode") %>';
but it only works when i refresh the page and do postback as the session variable is still set to the old value
Bookmarks