Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Jay #1
Validation
Hello all,
I'm very new to ASP.NET and I am using VS.NET to write my pages.
I am using the Regular Expression Validator on my form and I would like it
to check a field to make sure it does not equal 0. Can anyone point me to
some resources with this type of information?
Thanks,
- J
Jay Guest
-
CFFORM validation trumping Custom Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
CFFORM Validation trumping Custom Form Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
'Either Or' Validation
This might not be an advanced topic, but I need to be able to validate an HTML form, and for that matter, Flash forms, to check that the user... -
validation summary doesnt display when there's client-side validation
I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so... -
only custom validation control does server side validation?
On a CustomValidator you have to provide the validation code because otherwise it doesn't know what to do for the validation. Other validator... -
Karl Seguin #2
Re: Validation
While you could use a RegExVal for this and check for [^0] or something, you
could also use a requiredfieldvalidator and set the initialvalue="0"
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsRequiredFieldValidatorC lassInitialValueTopic.asp[/url]
Karl
"Jay" <jerry280@yahoo.com> wrote in message
news:eWCJ5TvSDHA.1036@TK2MSFTNGP10.phx.gbl...> Hello all,
>
> I'm very new to ASP.NET and I am using VS.NET to write my pages.
>
> I am using the Regular Expression Validator on my form and I would like it
> to check a field to make sure it does not equal 0. Can anyone point me to
> some resources with this type of information?
>
> Thanks,
>
> - J
>
>
Karl Seguin Guest
-
Jay #3
Re: Validation
That work perfectly!
Thanks!
- J
"Karl Seguin" <kseguin##crea.ca> wrote in message
news:ufYnEtvSDHA.2852@tk2msftngp13.phx.gbl...you> While you could use a RegExVal for this and check for [^0] or something,[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsRequiredFieldValidatorC lassInitialValueTopic.asp[/url]> could also use a requiredfieldvalidator and set the initialvalue="0"
>
>it>
> Karl
>
> "Jay" <jerry280@yahoo.com> wrote in message
> news:eWCJ5TvSDHA.1036@TK2MSFTNGP10.phx.gbl...> > Hello all,
> >
> > I'm very new to ASP.NET and I am using VS.NET to write my pages.
> >
> > I am using the Regular Expression Validator on my form and I would liketo> > to check a field to make sure it does not equal 0. Can anyone point me>> > some resources with this type of information?
> >
> > Thanks,
> >
> > - J
> >
> >
>
Jay Guest
-
odette007 #4
validation
Hi all!
Can you please help me here?
I need to validate a form with get method and textarea input....
I tried
A)
<script Language="JavaScript">
function validRequired(formField,fieldLabel)
{
var result = true;
if (formField.value == "")
{
alert('Invalid entry. Please type information.');
formField.focus();
result = false;
}
return result;
}
function validateForm(theForm)
{
if (!validRequired(theForm.question,""))
return false;
return true;
}
</script>
<cfoutput>
<FORM ACTION="#ActionURL#" METHOD="GET">
<TR>
<TD><!---<INPUT TYPE="TEXT" NAME="question" VALUE="<CFIF
IsDefined("question") AND question NEQ "">#question#</CFIF>" > </td>--->
<textarea name="question" rows="2" cols="30" MAXLENGTH=""><cfif
isDefined("url.question")>#Trim(url.question)#</cfif></textarea>
</TD>
<td> </td>
<TD valign="bottom">
<INPUT TYPE="Submit" NAME="Submit" VALUE="Search">
</TD>
</TR>
</FORM>
</cfoutput>
B) I also tried server-side validation:
<cfscript>
if (Len(Trim(url.question)) EQ 0)
{
var_error = "Please enter keyword for search.";
break;
}
</cfscript>
None of these worked....
Thanks
odette007 Guest
-
blewis #5
Re: validation
In your JS example, you don't seem to be calling validateForm() anywhere to
get the whole process going. Add an onSubmit handler to the form tag:
<FORM ACTION="#ActionURL#" METHOD="GET" onSubmit="return validateForm(this)">
Bryan
blewis Guest
-
odette007 #6
Re: validation
Thanks, I tried that and is not working...It directs me to the next page without throwing an error message prior to that.. Whoud it matter since I pass variable as url? I don't think so...
odette007 Guest
-
blewis #7
Re: validation
The error is probably there, but the browser is just skipping it and
submitting anyway. I highly recommend using Netscape/Mozilla/FireFox for JS
debugging and opening up the JavaScript console. This gives you much more
information about JS problems than IE does.
You may also want to change:
if (!validRequired(theForm.question,""))
return false;
return true;
}
to:
if (!validRequired(theForm.question,"")) {
return false;
} else {
return true;
}
just to be explicit about the if blocks.
blewis Guest
-
AnoPres #8
Re: validation
As long as you can be sure that your user has javascript enabled, try changing
your submit button:
<INPUT TYPE="Submit" NAME="Submit" VALUE="Search">
to
<INPUT TYPE="button" name="btnSubmit" value="Search"
onClick="validateForm(this.form);">
then change the validateForm function to:
function validateForm(theForm)
{
if (validRequired(theForm.question,""))
{
theForm.submit();
}
}
You also want to be careful using name="submit" becuase you can sometimes
create bump into a reserved word issue.
AnoPres Guest
-
rajesh #9
validation
Hi,
I'm using Yaromat for validation the update form
It works fine.
but you can't validate on like this example
for example
if checkbox = true
messagebox " textbox is mandantory"
end if
is there a way to do this?
please advise
kisoen
rajesh Guest
-
vortexweb #10
Validation
Have a few questions for anyone out there who has a answer or who can point me
in a direction to find the answers.
The one thing that really bugs me in Dreamweaver is there open ended
statements. Like:
The tag: "td" doesn't have an attribute: "width" in currently active
versions.[XHTML 1.0 strict] I ask myself? OK, so give me a solution to the
problem? maybe im missing something but when I come across something like this
where should I go to get a answer?
I keep thinking there should be some kind of button " Fix It" in dreamweaver...
Thanks
vortexweb Guest
-
rob::db #11
Re: Validation
It means you're trying to use the 'width' attribute in a <td> tag, which
isn't valid according to the DTD that you're using (XHTML 1.0 strict). The
answer is to get rid of the 'width' attribute and replace it with CSS.
vortexweb wrote:> Have a few questions for anyone out there who has a answer or who can
> point me in a direction to find the answers.
> The one thing that really bugs me in Dreamweaver is there open ended
> statements. Like:
> The tag: "td" doesn't have an attribute: "width" in currently active
> versions.[XHTML 1.0 strict] I ask myself? OK, so give me a solution
> to the problem? maybe im missing something but when I come across
> something like this where should I go to get a answer?
> I keep thinking there should be some kind of button " Fix It" in
> dreamweaver... Thanks
rob::db Guest
-
vortexweb #12
Re: Validation
I have one more request of anyone out there.
when I go to place a flash file on my doc. dreamweaver adds a embed statment
to the code, this statment is: The tag name: "embed" Not found in currently
active versions.[XHTML 1.0 transitional]
Do you know away around this??
vortexweb Guest



Reply With Quote

