cfform tag on wincf2

ZtaCari

Perch
I am using the code below to submit a search form.

Code:
<cfform name="QuickSearch" action="/classifieds/searchResults.cfm" method="post">
	<cfinput type="text" name="txtQuickSearch" size="20" maxlength="100" required="yes" message="Please enter a search value.">
	<input type="submit" name="submit" width="100" value="Search"><br/>
	<a href="/classifieds/advancedSearch.cfm">Advanced Search</a>
</cfform>

I have made it required and would think that the site would throw an error if the user doesn't enter a value, but all it does is submit the form. Am I doing something wrong here?
 
Probably the CFIDE virtual directory is missing. Create a ticket with URL of your form.
 
ZtaCari said:
I am using the code below to submit a search form.

Code:
<cfform name="QuickSearch" action="/classifieds/searchResults.cfm" method="post">
	<cfinput type="text" name="txtQuickSearch" size="20" maxlength="100" required="yes" message="Please enter a search value.">
	<input type="submit" name="submit" width="100" value="Search"><br/>
	<a href="/classifieds/advancedSearch.cfm">Advanced Search</a>
</cfform>

I have made it required and would think that the site would throw an error if the user doesn't enter a value, but all it does is submit the form. Am I doing something wrong here?

If Tanmaya's fix does not work for you then check the Javascript settings on the client. My first thought is that perhaps the browser has Javascript disabled (the CFForm validation method is done using Javascript). Alternately you might try adding in value="" to the CFInput type or using RegEx to make sure that something is entered in the "validate" attribute.
 
Back
Top