You write javascript in the same way that you write HTML:

document.formname.city = "<%=cityvariable%>";

And just leave the textbox values the way they are now, as the default.

Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
 

-----Original Message-----
From: Diane Schips [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 14, 2002 11:43 AM
To: ActiveServerPages
Subject: RE: form within a form problem

OK, first problem - I can get all the address variables when I first
load
the page, but how do I get javascript to read server generated
variables?  I
also (at the moment) have the text box values set to the server
variables
i.e.:

<Input type="text" name="box" id="box" value="<%=variable%>">

I admit I haven't used much javascript, though I'm always willing to
expand
my horizons.

Diane

-----Original Message-----
From: Matthew Small [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 11:23 AM
To: ActiveServerPages
Subject: RE: form within a form problem


You can use javascript to achieve this.

<select name="address" onchange="changeaddresses(this.SelectedIndex);">
        <option>Address1</option>
        <option>Address2</option>
        <option>Address3</option>
        <option>Address4</option>
</select>



<script language="javascript>
        function changeaddresses(choice) {
                switch (choice) {
                        case 0: {
                                document.formname.address1 = "Your
Address1";
                                document.formname.city = "Your City1";
                                ...}
                        case 1: {
                                document.formname.address1 = "Your
Address2";
                                document.formname.city = "Your City2";
                                ...}
                }
        }
</script>

My syntax might be a little bit off but the idea and logic is the same.


Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com


-----Original Message-----
From: Diane Schips [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 11:05 AM
To: ActiveServerPages
Subject: form within a form problem

This is what I'm trying to do.  I have a page with a member's title,
first
name, middle name, and last name.  Below that I have one of the complete
addresses along with an effective date.  There are four address that can
be
seen, with a drop down box to allow the user to select which one.  I'd
like
to not have to have a submit button for the address list, but have it
work
as soon as a selection is made.  Below this I have phone numbers.  Some
of
these phone numbers will change with the address viewed.  Finally, I
have
the submit and delete buttons for the page.  It looks something like
this:

Viewing member: <list box> Submit

title        First Name   Middle Name   Last Name
<text box>   <text box>   <text box>    <text box>

<address list box>  <address 1 text box>  <address 2 text box>
                          <city text box>       <state><zip text boxes>
                    <country text box>    <effective date text box>

Phone: <text box>   Fax: <text box>   Cell Phone: <text box>
Email: <text Box>                     Pager: <text box>

                        Update  Delete

This puts me in the unenviable position of needing a form within a form.
I
want the user to be able to select the address to view, and the update
button to update all visible data.  If address 1 is the default address
shown, but the user selects address 2, then makes changes, I want to
update
address 2 when the update button is pressed.

This is the format I was asked to follow.  They want the 'look and feel'
to
be the same as a desk top version written in VB.  I'm sure there has got
to
be a way to pull this off.  Any ideas?

Thanks,
Diane


---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%




---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%


---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to