Kickstart The Oracle
Joined: 04 Feb 2002 Karma :
|
Posted: 15:00 - 09 Feb 2006 Post subject: ASP / Javascript / Forms help |
|
|
Hi
Another question.
I have a page with a form. One of the values on the form is a 2 character code with a stupid number of possible values (way too many to put in a drop down list).
I have knocked up a 2nd page listing the possible values (90% of the time the user will know as they will only use a small subset of values), and the user can click on one of these to populate the field on the form. Works fine.
Trouble is that there are multiple fields which want to use this pop up screen (it is an application ID, and there are to application IDs and from application IDs), and the field is currently populates is hard coded.
I know I need to pass across the ID of the field I want it to populate. How do I source this in form for the URL that kicks off the pop up screen, and how do I refer to this in the Javascript function that populates the field on the form?
Current code fragments as follows.
This is the original URL to kick off the pop up window.
Original URL wrote: |
<a HREF="ApplicationIdList.asp?document.getelementid["txtToApplId"]" onclick="window.open('ApplicationIdList.asp' _ApplicationIds', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=318');return false;" target="_ApplicationIds">Application Id</a>
|
Url to click on to select the appropriate value.
URL to set value of field wrote: | <a href="javascript:ApplId('<%= rsX.fields(0) %>',<%= request(fieldNode) %>)"><%= rsX.fields(0) %></A
|
Function to populate the field on the original form (in this case txtToApplId).
Javascript function wrote: |
function ApplId(text) {
opener.document.forms['form1'].txtToApplId.value = text;
opener.document.forms['form1'].txtToApplId.focus();
window.close();
|
All the best
Keith ____________________ Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing |
|