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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get value problem

Status
Not open for further replies.

Benbunny

Programmer
Mar 19, 2001
18
HK
Hi all,

I would like to ask out a simple question, can anyone help me?

I want to let the user input a date into the field(ifindrec) and then the user press "By Date" button. It will pass the value of "ifindrec" to "FindForm.cfm".

<html>
<FONT face=Arial size=2>Find Rec. </FONT>
<INPUT NAME=&quot;ifindrec&quot; SIZE=&quot;10&quot; MAXLENGTH=&quot;10&quot; value=&quot;&quot;>
<input type=&quot;Button&quot; value=&quot;By Date&quot; Onclick=&quot;location.href='FindForm.cfm?info=#ifindrec#&findby=D'&quot;>
</html>

But now I facing a problem as belows:
------------------------------------------------------------
Error resolving parameter IFINDREC

ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:

You have misspelled the parameter name, or
You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.
------------------------------------------------------------

Thanks so much!


 
BTW What value does 'ifindrec' holds, because until u use CFOUTPUT to display the value, (it should be available to the CF programme, if not u), then only you can expect the result value of the variable to be available to the next form.

HTH

Amit
 
Actually I wanna to pass a date format into input field &quot;ifindrec&quot;, but it shows empty in the next page &quot;'FindForm.cfm&quot;.

I've tried input a string, the outcome is the same null.

Thanks! Can you help me?


 
I'll assume your input buttons are enclosed in FORM tags. bhargarva is right, you must enclose your form in CFOUTPUT tags in order for the variables to be passed. I went through a lot of frustration before I finally figured that out. Calista :-X
Jedi Knight,
Champion of the Force
 
Hi,
It also looks like the button you have is bypassing the submit. You are actually trying to send your value through a URL variable named 'info' . That would work just fine, and you could access your variable on the next page as #Url.Info# . EXCEPT as Bhargava said that value isn't available to you as a CF variable until that form is submitted. SO, Check with the JavaScript guys (unfortunetly I'm a javascript baby) about how to put a form variable on a URL.

OR. You can go ahead and submit the form and then it will be in your next page as #form.ifindrec#.

that would look like this:
<input type=&quot;Submit&quot; value=&quot;By_Date&quot; name=&quot;D&quot;>
Then on your next template there will be a variable named By_Date with the value &quot;D&quot; so you can check which submit button was pressed (IF there are others)

Hope it Helps...
HAVE fun.

 
Try this

Onclick=&quot;location.href='FindForm.cfm?IFINDREC=document.formname.ifindrec.value&findby=d&quot;

replace the &quot;formname&quot; with form name specified in form tag. Then you should able to get the value for #ifindrec# in findform.cfm


 
Hey Ram123,

I was going to suggest that exact line but I tried it and it sends the text &quot;document.formname.ifindrec.value&quot; as the value of IFindRec how do I get it send the value instead of the text? I Actually named the form &quot;formname&quot; so that isn't the problem. What Am I doing wrong?

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top