close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can validate fields using space

Thread began 8/26/2009 5:19 pm by saf01 | Last modified 8/28/2009 9:34 am by Jason Byrnes | 1775 views | 3 replies |

saf01

Can validate fields using space

Hi. I have two questions, perhaps someone can help me with.

[1] When I validate a text field and preview it in my internet browser, I can just hit space on any text or number field and it validates. Is there a way I can set it so that you can't use just spaces to validate a field?

[2] Im designing an order form to sell physical goods e.g. paper weights that light up.
The form will have 2 products (different sizes), each product will have a quantity field
and a total value will be displayed when a user presses the submit button. Please can someone help me to design this using css form builder?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

Make sure to check the Required Attribute. If you do not select the required attribute for the form field, you will be able to enter a space.


Are you saying you want to get the total of the two quantity fields? If so you can do simple math on the values entered.

for this example, the quantity form elements are named qty1 and qty2

php:
<?php

if((isset($_POST['qty1']) && is_numeric($_POST['qty1'])) && (isset($_POST['qty2']) && is_numeric($_POST['qty2']))) {
    
$totalQTY $_POST['qty1'] + $_POST['qty2']
    echo(
totalQTY);        
}
?>
Sign in to reply to this post

saf01

Thanks Jason.

Please could you tell me how I can check the required attribute. All i want to do is to stop people adding only a space in the form field to validate it. So you can type words and spaces but not just a space to validate a field.

Please help.

Sign in to reply to this post

Jason ByrnesWebAssist

When Creating the form in Form Builder, click the Edit Button Next to the Forms name, In the edit Form Contents screen, select the group that contains the form element you wish to edit, the click the edit button.

Select the Form Element in the list, then check the required box in the validation section.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...