Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 26542

Classic ASP send stringtext back to parent page textbox that has focus

$
0
0

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") %>';

 

 

this works but it only works when i refresh the page and do postback as the session variable is still set to the old value


Viewing all articles
Browse latest Browse all 26542

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>