Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 11:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Check all fields have data entered before database write
PostPosted: April 18th, 2008, 7:18 am 
Offline

Joined: April 18th, 2008, 7:15 am
Posts: 3
Location: Melbourne
Hi,

I have a page with several text fields and several radio buttons, I would like to be able to check to make sure that a user has entered data in every field and answered every radio button before allowing them to click the next button that writes that data to the database. Cant think of an easy way to do it short of doing If/Then statemenets for each and every variable which would be a pain, I am sure mny of you have done this before and I am missing something simple :)


Cheers


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 18th, 2008, 7:29 am 
Set up a variable, eg. COUNT_CLICKS.

Hide or Disable the NEXT button.

Each time a radio button is clicked, increment the variable.

When the variable equals the number of radio buttons, either show the Next button, or enable it.

This is a simple way of doing this. I'm sure you'll be given other solutions.

Please open your profile (top of screen, find the Signature section and enter details of your hardware and software like I have done. Doing this makes it easier for us to help you.


Top
   
 
 Post subject:
PostPosted: April 18th, 2008, 7:48 am 
Offline

Joined: April 18th, 2008, 7:15 am
Posts: 3
Location: Melbourne
Hi,

Thanks for that, any idea how I do the check for text boxes though as the number of clicks/keyboard presses will vary so I cant do a count for them.

Also, would love to update my Profile, but I must be missing something, I click on Profile at the top of the page, and there is a section for username and password then a series of radio buttons regarding how to be notified etc, even one that says to always add a signature but nowehere can I see the area where i can enter all that information for my signature?


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 18th, 2008, 7:51 am 
Offline

Joined: April 18th, 2008, 7:15 am
Posts: 3
Location: Melbourne
Ahh got the Profile bit happening, suddenly there were more fields after clicking on it a few times, strange?

_________________
Opus 6.00v under XP PRO SP2 with 4 gig of RAM (3 gig switch enabled), Core 2 Duo 6600, ATI Radeon HD2600XT, Dual Monitors, BlackMagic MultiBridge Pro


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 18th, 2008, 8:10 am 
Quote:
any idea how I do the check for text boxes though as the number of clicks/keyboard presses will vary so I cant do a count for them.


Couple of ways.

1. Read up on the KEY PRESS trigger which could update the variable any time a key is pressed inside an input box. You can select specific key(s) or choose to have any key press update the variable.

2. Have a look at the TEXT INPUT tab for the Properties of any text input object. Here you will find a couple of properties that might help you.


I think using #1 is the better approach, but #2 might work if it meets any specific needs you have.

You can also set it up to only update the variable once a specific string has been typed.

How and what you do really depends on what you need, but Opus is flexible enough to cater to most needs.

There are some neat solutions using scripting, but with a newbie, I'm not going near those :)

HTH


Top
   
 
 Post subject:
PostPosted: April 18th, 2008, 9:14 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Evan,

Okay, lots of approaches available in Opus. Here some some ideas you might explore. I'm assuming you are 'into' scripting.

>>>Check out the suggestions and code examples at the end of the following post.
viewtopic.php?t=2688&highlight=text+input+return
Basically, checking for a NOT 'null' condition of User Text-Input.

>>> you can use 'AND' operators in your 'if' statements.... see the '&&' in syntax section of help files.

>>> As suggested by Sentosa above, you can control a good portion of this task by how you let the User navigate. For example, you can only put so much on a page (well, you can put a lot and stack it up, but let's say we don't). You could Show() or Enable() the button for "Proceed" (or "next page" etc.). That routine could essentially be duplicated on subsequent pages... so maybe you are only checking 8 things at that time for completion, then moving on. ( somewhere here you have to think through... are these Pub vars, or Page vars (persistent??). When do you write these to a file or database?)

>>> If I recall Radio Buttons can be set up to have a "default" Radio "depressed" initially. That could be a distinct Rad Button that holds a 'stop' code or 'false' (not answered). Checking any other Rad Button, unchecks the default. (I've seen a couple approaches with Radio's by the way. One in DW's sample pubs has each radio button set its own specific Variable. Another approach is to associate the radio group to one Variable, each choice setting a different value for that variable.)

>>> Check out the Sample Pubs that ship with Opus Pro. Also, Search the forum for 'quiz' or 'student', or possibly 'question'. You will see how others use the SCORE accumulation to permit the student to "move on" in the pub. (there is a Question Wizard in Opus... I've not used).

Have a great weekend with your project.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group