close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Required Fields if Checkbox Selected

Thread began 7/01/2013 5:10 pm by Daryl | Last modified 7/15/2013 5:27 pm by Daryl | 957 views | 23 replies

DarylBeta Tester

I have tried replicating the code that you have suggested based on the code generated by Form Builder.

I have ended up with

php:
<?php echo((isset($_GET["EmploymentStatus"]) && $_GET['EmploymentStatus'] = "Employed")?ValidatedField("ApplicationForm","EmployersName"):"")); ?>



However this produces a Syntax error in dreamweaver.

I wasnt sure what I would use for the validation part, you used a telephone number example, as this is just a required field

Code for the Radio Button

php:
<input type="radio" name="EmploymentStatus" id="EmploymentStatus__1" value="Employed" class="formRadioField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("ApplicationForm","EmploymentStatus"):""),"Employed"))) {echo "checked=\"checked\"";} ?> tabindex="19">



Code for the Form Field that only requires validation if the above button is checked

php:
<input id="EmployersName" name="EmployersName" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("ApplicationForm","EmployersName"):"")); ?>" class="formTextfield_Large" tabindex="24" onBlur="hideServerError('EmployersName_ServerError');">



Also I am unsure as to why everything is $_GET when the form was created as $_POST and also submits using $_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...