• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

validate textbox

Guest
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

Hi i have 2 small problems

1. i have a text box which gets submited to an action page where the value is inserted into the table.

what i need to do is, before the page is submited to the action page

if the name typed in the text box already exsits in the column names, to show an message box saying name already taken choose another...

if the name dose not exsit in the column names to go to the action page.


2. with message boxes is there a way of centering the message? i have used \n for line breaks.

hope someone can help

thanks
TOPICS
Advanced techniques

Views

208

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

Problem 1 - The only way to do this prior to going to the action page is to query every record and send the values to a javascript array. If you have a lot of records, this will make your form page painfully slow. You are probably better off letting the user submit the form and run a query to see if the value has been used.

Problem 2 - What's a message box? Is that the same as a textarea? If so, what do you mean by centred?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

ok thanks

if i let the user submit the query how can i check to see if the name exsists, and if it dosnt exsist i would need it to go back a page so the user could try again how would i do this

i just need to center the text of a pop up message box when using a cfform required message

many thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

LATEST
When the form is submitted, have the action page query the database to see if the name already exists. If it does, do a CFLOCATION back to the form page. You can put a message in the CFLOCATION URL that says:
?msg=The name already exists. When you load the form page, check to see if URL.msg is defined. If so, display the message.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation