Print Page | Close Window

Dependant Fields

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=15284
Printed Date: 30 March 2026 at 6:55am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Dependant Fields
Posted By: yad00g
Subject: Dependant Fields
Date Posted: 29 May 2005 at 10:55pm
Is it possible to dynamically fill in form fields dependant on what is selected in a dynmaic drop down list without submitting, ie: "on the fly".
 
Thanks.



Replies:
Posted By: ub3rl337ch3ch
Date Posted: 29 May 2005 at 11:05pm
if you want to fill it in the fields from a database then the best you can do is do a js onchange (on the dropdown) to post the form to a new window which contains the asp to interface with the db. using opener.focus at the very head of the page (in js tags) means that it shouldn't be too annoying for users. then create a bunch of hidden fields in the second page like so:
<form name="theform">
<input type="hidden" name="thefield" value=<%=vrec("thefield")%>> 
<input type="hidden" name="thefield2" value=<%=vrec("thefield2")%>> 
</form>
Then run some js like this:
<script language="javascript">
opener.document.form.field1.value = document.theform.thefield1.value
opener.document.form.field2.value = document.theform.thefield2.value
</script>
 
Downside of this is it doesnt work if people have blocked popups, or if they've disabled js, and it is a bit messy.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net