Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to store a value after entering it once until the user wants to ch 1

Status
Not open for further replies.

yogi564

Programmer
Oct 16, 2001
48
0
0
AU
Hi all,

I wondering if it is possible to store a value after entering it once until the user decides to change it. For example I want to have two form tags in one cfm page. The first form tag has only one field in it called Date. When the user enter a date in the first form tag and clicks on the submit button it should go and submit the information within the second form tag which is got the <CFINSERT> command place in it. The second form tag has got three fields called DATE, NAME, DEPTH. What it has to do is that the date field should be automatically filled out for the 10 empty fields called Date in the second form tag, using the entered date in the first form tag. CAN THIS BE DONE! If so how? Thank's
 
wrong forum guy! you gotta use JavaScript here;
use the onBlur event with the date field of the first form:

<form name=&quot;form1&quot;...
<input type=&quot;text&quot; name=&quot;date&quot; onBlur=&quot;(document.form2.date5.value=this.value,document.form2.date6.value=this.value)&quot;...


<form name=&quot;form2&quot;...
<input type=&quot;text&quot; name=&quot;date5&quot;...
<input type=&quot;text&quot; name=&quot;date6&quot;... Sylvano
dsylvano@hotmail.com
 
If you start using Dreamweaver 4, all these kind of problems will be solved in the easiest way.
Sergio
 
I'm not 100% sure what you are trying to do, but it may be easier to encapsulate everything into one form tag and name your submit buttons. Then on the page it submits to, check to see what button they pressed and handle your submission any way you want. That way you can use whatever formfields are filled out.

e.g.
<form action=&quot;page2.cfm&quot; method=&quot;post&quot;>
<input type=&quot;Text&quot; name=&quot;Date1&quot;>
<input type=&quot;Submit&quot; name=&quot;cmdSubmit1&quot; value=&quot;Submit 1&quot;>

<input type=&quot;Text&quot; name=&quot;Date2&quot;>
<input type=&quot;Submit&quot; name=&quot;cmdSubmit1&quot; value=&quot;Submit 2&quot;>

</form>

page2.cfm
<cfif isDefined(&quot;form.cmdSubmit1&quot;)>
... Process whatever you want if they pressed Submit 1 here

<cfelse>
... Process whatever you want if they pressed Submit 2 here

</cfif>
 
Hi serbonf

I am using Dreamweaver Ultrav 4?? I believe that has more capability than Dreamweaver 4 itself.
 
Hi WWebSpider

&quot;wrong forum guy!&quot;

How can you say this question is in the wrong forum. I am using Cold fusion tag as well as javascript to work out most of my pages. I hope you know about the Repeat statement in cold fusion. Therefore I beleive this is quite sufficent place to put it. 50-50. That's all. Anyway thank's for you help.
 
with all due respect, I stand behind my post: if you want to populate multiple form fields, based on the value of the date field you have in the first form, the best way is to use JavaScript events.

one is to use onBlur event to set the values of the other fields you need, and second is to use onSubmit or onUnload event to submit as many forms as you want.

both are JavaScript, k?
Sylvano
dsylvano@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top