ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 19th, 2003, 05:32 PM
blues82 blues82 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 97 blues82 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 5 sec
Reputation Power: 5
passing form data within a form

I am trying to create a form where the user can check a box within a form and the address will fill in automatically from a previous address in the form, without submitting the form. Can anyone help please, thank you.

Reply With Quote
  #2  
Old October 20th, 2003, 02:27 AM
Buraque Buraque is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58 Buraque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
JavaScript will be the best solution for this.
I will write an example code for you when I back home...
cheers...

Reply With Quote
  #3  
Old October 20th, 2003, 10:50 AM
Buraque Buraque is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58 Buraque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
Here is the code. tested and verified
unchecking the box will empty the second address fields.

I don't know if there is easier way to do this, I am not an expert, yet

PHP Code:
<%@LANGUAGE="VBSCRIPT"%>
<
html>
<
head>
<
title>Untitled Document</title>
<
meta http-equiv="Content-Type" content="text/html; charset=1252">
</
head>
<
script language="JavaScript" type="text/JavaScript">
function 
copyaddr()
{
    if(
document.form1.check.checked==true){
    
document.form1.addressB1.value document.form1.addressA1.value
    document
.form1.addressB2.value document.form1.addressA2.value
    document
.form1.addressB3.value document.form1.addressA3.value
    
}
    if(
document.form1.check.checked==false){
    
document.form1.addressB1.value ""
    
document.form1.addressB2.value ""
    
document.form1.addressB3.value ""
    
}
}

</script>

<body>
<form action="/action.asp" name="form1">
<input name="addressA1" type="text"><BR>
<input name="addressA2" type="text"><BR>
<input name="addressA3" type="text"><BR><BR>

same address?<input name="check" type="checkbox" value="usesame" onClick="copyaddr()"><BR>
<input name="addressB1" type="text"><BR>
<input name="addressB2" type="text"><BR>
<input name="addressB3" type="text"><BR>
<input name="" type="submit"><input name="" type="reset">
</form>

</body>
</html> 

cheers
__________________
Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
Gilmour

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > passing form data within a form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway