I think u are after a confirm box:

confirm();

At 11:55 28/11/2003, you wrote:
You could try this...

<input type="submit" value="Submit Form"
onClick="return(checkForm(this.form));" />

Then in the JS:

<script language="Javascript">
function checkForm(myform) {
        if(myform.comments.value.match(/^\s*$/)) {
                // it's empty
                alert('You must enter a value for comments');
                return false;
        }
        else {
                return true;
        }
}
</script>

Regards

Mike

-----Original Message-----
From: Lovelock, Richard J [mailto:[EMAIL PROTECTED]
Sent: 28 November 2003 11:53
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] CFForm text box


Thanks Colm - I remember that from my FastTrack course now!


however I was hoping to do it client-side...

Paul - thanks for that code....almost works but not quite. I get the
alert box and message as requested BUT when I OK the alert message the
form still submits itself???

CODE IS:
<script language="Javascript">
function checkForm(myform) {
        if(myform.comments.value.match(/^\s*$/)) {
                // it's empty
                alert('You must enter a value for comments');
        }
        else {
                myform.submit();
        }
}
</script>

<textarea name="comments" cols="50" rows="12"></textarea>

<input type="image" src="images/submit.gif"
onClick="checkForm(this.form);">

Is it because I am using an image for button???


_______________________________________________________ * Regards, Richard Lovelock Westminster City Council - Web Support Cap Gemini Ernst & Young Southbank 95 Wandsworth Road London SW8 2HG ( 0870 906 7482

_______________________________________________________


-----Original Message----- From: Colm Brazel [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 11:28 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] CFForm text box


No equiv cfform tag for this. You have to use something like <textarea name="mybox" cols="25" rows="20"> text</textarea> <input type="hidden" name="mybox_required" value="required">

Colm

-----Original Message-----
From: Lovelock, Richard J [mailto:[EMAIL PROTECTED]
Sent: 28 November 2003 11:06
To: 'cflist'
Subject: [ cf-dev ] CFForm text box


I have a form - using cfform - with a multiline text box (<textarea name="comments" cols="50" rows="12"></textarea>)

I want to use JS validation or cfform validation to make sure this box
has an entry before the form gets submitted and alert the user if it is
empty

however, I can't find the appropriate CFForm tag to do this - I have
found <cftextinput> and <cfinput type="text"> but none of these seems to
cater for multi-row boxes??? is there a tag for this?

_______________________________________________________<?xml:namespace
prefix = o ns = "urn:schemas-microsoft-com:office:office" />

*  Regards,
                Richard Lovelock

Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London
SW8 2HG

( 0870 906 7482

_______________________________________________________




======================================================= This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. =======================================================


--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003


-- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] For
human help, e-mail: [EMAIL PROTECTED]


======================================================= This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. =======================================================


-- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] For
human help, e-mail: [EMAIL PROTECTED]


-- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



Reply via email to