Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


ASP / Javascript / Forms help

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

Kickstart
The Oracle



Joined: 04 Feb 2002
Karma :

PostPosted: 15:00 - 09 Feb 2006    Post subject: ASP / Javascript / Forms help Reply with quote

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
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 18 years, 116 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.05 Sec - Server Load: 0.57 - MySQL Queries: 13 - Page Size: 30.03 Kb