alexfusion
Programmer
Hello everyone!
I must say thank you for the excellent help I get every time I post a question.
I will try to be clear:
I have a search form for an Intranet.The employee fill the form field entering for example the name of a customer.The action page is a new form that checks if the customer exists in the database.If this condition is true the form in the action page generate dinamically the fields containing the information about the customer,such as first and last name,address,etc.That is fine.
The problem is when the customer is not in the database.Because of the form fields are generated dinamically the fields don't appear.
Example code:
Action page:
<cfquery name="checkcustomer" datasource="datasourcename" maxrows=1 dbtype="ODBC">
SELECT customername FROM company_table
WHERE customername='#form.search#'
</cfquery>
<! as you can see search is the form field name of the search form ----->
<cfoutput query="checkcustomer">
<input type="text"name="customername" value="#nombre_cliente#">
<!-----as you can see here "value" is the content of the database field------------->
</ccfoutput>
Here is the problem:if the customer is not present in the database the field is not generated.
I need that if the customer is not in the database the field appears empty,that is ,the HTML attribute "value" would be nothing or blank.
I know that this is very complex to explain but I am trying to be clear.
Could you help me to find a solution?
Thank you everyone !!!
alexfusion
I must say thank you for the excellent help I get every time I post a question.
I will try to be clear:
I have a search form for an Intranet.The employee fill the form field entering for example the name of a customer.The action page is a new form that checks if the customer exists in the database.If this condition is true the form in the action page generate dinamically the fields containing the information about the customer,such as first and last name,address,etc.That is fine.
The problem is when the customer is not in the database.Because of the form fields are generated dinamically the fields don't appear.
Example code:
Action page:
<cfquery name="checkcustomer" datasource="datasourcename" maxrows=1 dbtype="ODBC">
SELECT customername FROM company_table
WHERE customername='#form.search#'
</cfquery>
<! as you can see search is the form field name of the search form ----->
<cfoutput query="checkcustomer">
<input type="text"name="customername" value="#nombre_cliente#">
<!-----as you can see here "value" is the content of the database field------------->
</ccfoutput>
Here is the problem:if the customer is not present in the database the field is not generated.
I need that if the customer is not in the database the field appears empty,that is ,the HTML attribute "value" would be nothing or blank.
I know that this is very complex to explain but I am trying to be clear.
Could you help me to find a solution?
Thank you everyone !!!
alexfusion