How can I validate a form if at least one of the three text fields is selected
Hi all
My form has many fields but 3 text fields here that I need to have the Viewer to enter text in a text field before hitting the submit button.
Don't know how to do in this regard.
Thank you
Courier says:
I can't understand how to ensure at least a field is selected by the Viewer on the three text fields, any thoughts?
Yes, I played a bit with this idea earlier today, but got distracted by other things.
What follows is based on the following:
- There is only one form on the page
- No validation is involved
- Each of these fields in the group that needs at least a field has "data-req1" (without the quotes) in its opening tag
For example, if you have a form like this:
Add the following just before the closing on the page tag:
document.forms[0].onsubmit = fillOne;
function fillOne() {
var elems = this.elements,
req1 = [];
for (var i = 0; i < elems.length; i++) {
if (elems[i].hasAttribute('data-req1')) {
req1.push(elems[i].name);
if (elems[i].value.search(/\S+/) != -1) {
return true;
}
}
}
alert('At least one of the following fields must have a value:\n' + req1.join(', '));
return false;
}
If you try to send the form without find out the name or the email field, you will get an alert dialog box and will refuse to submit the form. But if one or the other or both fields have values, the form will appear.
In other words, it will work with any number of fields that have "data-req1" in the opening tag. So much that one of these fields has value, submits the form.
Tags: Dreamweaver
Similar Questions
-
How can I get a session state value in my apex or DML text field
I put a session state in my procedure, in my text field in my I want to get the value of the form region. I try in my text field of the form in the default region, I try
BEGIN
APEX_UTIL.GET_SESSION_STATE('USER_SECURITY_PIN');
END;
but this does not seem to get the PIN of the session
How can I do this please
dave_414 wrote:
I put a session state in my procedure, in my text field in my I want to get the value of the form region. I try in my text field of the form in the default region, I try
BEGIN
APEX_UTIL.GET_SESSION_STATE('USER_SECURITY_PIN');
END;
but this does not seem to get the PIN of the session
How can I do this please
Depends on the Type of default property item.
Use a static text with Substitutions of State of Session with a string substitution of static text:
&USER_SECURITY_PIN.
or the body of the PL/SQL function (for example):
return apex_util.get_session_state('USER_SECURITY_PIN');
or Expression of PL/SQL with a bind variable reference:
:user_security_pin
-
How can I validate the data in the control file?
Consider that the SQLLoader reads the data entry of the path file and loads the data in the base tables up on top of the description specified in the control file.
First, the form is created:
create table sql_loader_1 (load_time date, digital Champ_1, Champ_2 varchar2 (10))
Example of control file:
load_1.CTL
load data
INFILE "load_1.dat", "str"\r\n"
insert into table sql_loader_1
(
load_time sysdate,
Champ_2 position (01:10).
Champ_1 position(11:20)
)
Note that positions 11 to 20 are loaded in positions 1 to 10 in Champ_2 and Champ_1. The load_time field is filled with time current (sysdate) load.
Here is the data. The name of the file (load_1.dat) had been specified with the statement for infile in the control file.
load_1.dat
0123456789abcdefghij
**********##########
foo bar
This is a very long line
and the next one is
short
declared the Champ_1 as a numeric data type, but the input data file contains the data "Sue"(position 11:20) so the sql loader adds not the record to the database instead the record is written in the bad file. But I want to validate the data of the "(position 11:20) is digital or not." How can I post this in the control file itself? If it is not possible, how can I validate it in the database? give me a sample code to explain thisHere are two ideas.
Idea 1: This control file will check to see if the data to be loaded in Champ_1 contains a number (including the negative and decimal).
load data infile 'load_1.dat' "str '\r\n'" insert into table sql_loader_1 ( load_time sysdate, field_2 position( 1:10), field_1 position(11:20) "decode(trim(translate(:field_1,'-0123456789.',' ')),null,:field_1,-999)" )
If Champ_1 is a number or null, it is passed through, as is. If there is no numeric characters (in addition to '-'and'.') a distinct value-999 will be inserted for you allow to load the rest of the columns and easy to see the lines had data that cannot be loaded in Champ_1. This idea has its flaws (a string like "... ("will always drain the .bad file)
Idea 2: Load the data into a staging table first (or define an external table) where all columns are VARCHAR2. Then use SQL or PL/SQL to validate data in the staging table in your process to move the data into the table with the actual data types.
-
HOW CAN SOMEONE VALIDATE MICROSOFT WINDOWS ONLINE?
How can someone validate windows genuine 7, 8, 10 online? / What is the secure link to validate windows genuine 7,8,10 online anytime?
Visit our page what to look for on the Microsoft How to Tell website...
-
How can I validate my copy of Windows XP
I am trying to create a copy of mssstool32 on a cd but it takes imapi v2. but it says that I have to validate my XP first.
How can I validate it?http://Windows.Microsoft.com/en-us/Windows/help/genuine/what-is-validation
Click Validate now on the right side.
-
How can I save a form so that the input data are visible. When I click on the cell, I can see what has been entered, but when I go to the next cell, the data is hidden again. I would like to print the file with the visible information that has already been entered.
To clarify what mentioned TSN, forms PDF that are used and saved by the application on a Mac are corrupt in a number of ways. When a form that has been corrupted by the Preview is opened in Acrobat/Reader, one of the symptoms is exactly what you describe. If you have access to Acrobat and the original form, empty, not corrupted, you can export the form data in a data file (e.g., FDF) and import the shape of FDF data in the blank form.
-
How can I combine 2 forms?
How can I combine 2 forms
IT IS AVAILABLE ON MOBILE!
This question made me think of mobile workflows. And it's quite possible with only Adobe Mobile applications. I created a tutorial today to show you how.
-
How can I integrate a form on my site and to set up a button "submit" for when people fill out and click Submit, the form will be sent to me in the form of attached pdf file?
Thank you!
Salvation;
This isn't a workflow that is supported by solutions of Adobe forms at this time.
Thank you
Josh
-
How can I reset my "authentication required" username and password? The fields are always filled with my old information.
Follow these steps to delete the recorded data (form) in a drop-down list:
- Click on the (empty) input field on the web page to open the drop-down list
- Select an entry in the drop-down list
- Press the DELETE key (on a Mac: shift + delete) to remove it.
- Tools > Options > Security: passwords: "saved passwords" > "show passwords".
You may need to clear cookies from this site, so if you checked a box to remember you.
-
How can I add a password to an existing network of the time capsule?
How can I add a password to an existing network of the time capsule?
I guess you mean that time Capsule has already been configured to provide a signal of wireless network, correct?
Do you mean that the network has no password at all right now... or... do you mean that the network has an existing password, but you want to change the password?
What operating system are you using on the iMac that you list in your profile?
-
How can ensure me that my iphone contacts are saved in the cloud and is not a crucial step if I buy a new iphone. I have 5
Help here > transfer content from your old iOS device to your new iPhone, iPad, or iPod touch - Apple Support
-
How can I add a photo to identify a contact in the Message
How can I add a photo to identify a contact in the Message
Names and images in Messages are removed from your App Contacts select the contact, tap Edit, then tap Add Photo.
-
How can I make a group of tiles is one fell swoop
How can I make a group of tiles is one fell swoop? Thank you very much for your help!
Please explain what you want to do - when you import photos into iPhoto, the thumbnails are generated automatically - youo need not to do something
and verisy you use OS X 10.6.8 as you say it and tell us what version of iPhoto you use
LN
-
How can I find and add drops to my favorites in the Finder window?
How can I find and add drops to my favorites in the Finder on my MacBook Air window?
Assuming that your MacBook Air and OS X version can support AirDrop, use the menu on the Finder to go to Finder > Preferences > sidebar and tick the box 'parachuting '.
-
The ID I used before is is longer in service, how can I change to a new ID if I know the old ID and the old password?
Start here:
Maybe you are looking for
-
I have an iMac (early 2013 21.5 inch 8 GB) which stops and then restarts unexpectedly often more than once a day. I ran the diagnostics of material, check the permissions and disk. All are no problem. Any suggestions? I bought this machine this June
-
I download a lot of PDF files and I organize their file name. I want to record on my computer to read later. When I have a PDF document is opened in the browser, it's particularly embarrassing. As it is, I have two options: Save the file:This automat
-
Satellite C650 - external monitor turns on for about 2 seconds
Hey I want to connect a digital diamond (I think Acer) external moniter for my Toshiba Satalite C650 and it lights up for about 2 seconds then black flshes again. I tried to lower the resolution and 12 pins cable is tight it flashes just black. He ne
-
G61-110SA: upgrade CPU G61-110SA
As a pc engineer, I tried to upgrade my laptop to HP G61 aging wives with a better processor of speck. It was equipped with an Intel pentium T4300 2.1 Ghz CPU P 487 outlet again. I tried to change to a P8600, but the laptop refuses to boot? I did sev
-
Anyone know how to contact a Yokogawa USB WT500 power Analyzer? I VI Yokogawa LV and have installed the USB but the WT500 driver does not appear in MAX and USB doesn't seem to be an option in the resourse VISA. It does not appear as a comm port eithe