close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Help with Condition Validation...

Thread began 2/09/2010 1:56 pm by Gareth.TannattNash253613 | Last modified 2/23/2010 10:44 pm by Gareth.TannattNash253613 | 2064 views | 15 replies

Gareth.TannattNash253613

Hi Dani,

No Joy I'm afraid, I've updated the form so that it reads like this -

<form action="" method="post" name="updateaccount" id="updateaccount" onsubmit="WAAlertErrors('The following errors were found','Correct invalid entries to continue',true,false,false);return document.MM_returnValue">
<fieldset>
<h3>Account Detail</h3>
<ul>
<li>
<label>Account Type <span class="redx">*</span>: </label>
<select name="accounttype" id="accounttype" onchange="
if(document.getElementById('accounttype').options[document.getElementById('accounttype').selectedInd ex].value = 'm') {
WAValidateCD(document.forms[0].accounttype,document.forms[0].dmxCalendar_1,false);
WAValidateEN(document.forms[0].accounttype,document.forms[0].dmxCalendar_1,false);
WAValidateCD(document.forms[0].accounttype,document.forms[0].dmxCalendar_2,false);
WAValidateEN(document.forms[0].accounttype,document.forms[0].dmxCalendar_2,false);
WAValidateEN(document.forms[0].accounttype,document.forms[0].FreeTrial,false);
document.forms[0].dmxCalendar_1.disabled = false;
document.forms[0].dmxCalendar_2.disabled = false;
document.forms[0].FreeTrial.disabled = false;
}
else {
document.forms[0].dmxCalendar_1.disabled = true;
document.forms[0].dmxCalendar_2.disabled = true;
document.forms[0].FreeTrial.disabled = true;
}">
<option value="m" <%If (Not isNull((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then If ("m" = CStr((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Fixed Term Contract</option>
<option value="a" <%If (Not isNull((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then If ("a" = CStr((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Pay as You Go</option>
</select>
</li>
<li>
<label>Start Date <span class="redx">*</span>: </label>
<input type="text" id="dmxCalendar_1" name="dmxCalendar_1" readonly="readonly" />
<script type="text/javascript">
// <![CDATA[
$(function() {$('#dmxCalendar_1').datepicker({
skin : "dmxCalendar",
dateFormat : "M d, yy",
showStatus : true,
numberOfMonths : [1,1],
showAnim : "fadeIn",
showOptions :
{
easing : "easeOutBounce",
direction : "up"
},
duration : "normal",
showOn : "both",
buttonImage : "../Styles/dmxCalendar/calendar_icon.gif",
buttonImageOnly : true,
prompt : ""
});})
// ]]>
</script>
</li><li>
<label>End Date <span class="redx">*</span>: </label>
<input type="text" id="dmxCalendar_2" name="dmxCalendar_2" readonly="readonly" />
<script type="text/javascript">
// <![CDATA[
$(function() {$('#dmxCalendar_2').datepicker({
skin : "dmxCalendar",
dateFormat : "M d, yy",
showStatus : true,
numberOfMonths : [1,1],
showAnim : "fadeIn",
showOptions :
{
easing : "easeOutBounce",
direction : "up"
},
duration : "normal",
showOn : "both",
buttonImage : "../Styles/dmxCalendar/calendar_icon.gif",
buttonImageOnly : true,
prompt : ""
});})
// ]]>
</script>
</li><li>
<label>Free Trial: </label>
<input name="FreeTrial" type="checkbox" id="FreeTrial" value="Y" />
</li>
<li>
<label></label>
<input type="submit" name="update" id="update" value="UPDATE" />
</li>
</ul>
</fieldset>
</form>

When I test it, none of the fields are disabled or validate (regardless of the select value)

I also changed the form so that it looks like this -

<form action="" method="post" name="updateaccount" id="updateaccount" onsubmit="WAValidateRQ(document.forms[0].dmxCalendar_1,'Start Date is required',document.forms[0].dmxCalendar_1,0,false,'text');WAValidateRQ(document.forms[0].dmxCalendar_2,'End Date is required',document.forms[0].dmxCalendar_2,0,false,'text');WAAlertErrors('The following errors were found','Correct invalid entries to continue',true,false,false);return document.MM_returnValue">
<fieldset>
<h3>Account Detail</h3>
<ul>
<li>
<label>Account Type <span class="redx">*</span>: </label>
<select name="accounttype" id="accounttype" onchange="
if(document.getElementById('accounttype').options[document.getElementById('accounttype').selectedInd ex].value = 'm') {
WAValidateCD(document.forms[0].accounttype,document.forms[0].dmxCalendar_1,false);
WAValidateEN(document.forms[0].accounttype,document.forms[0].dmxCalendar_1,false);
WAValidateCD(document.forms[0].accounttype,document.forms[0].dmxCalendar_2,false);
WAValidateEN(document.forms[0].accounttype,document.forms[0].dmxCalendar_2,false);
WAValidateEN(document.forms[0].accounttype,document.forms[0].FreeTrial,false);
document.forms[0].dmxCalendar_1.disabled = false;
document.forms[0].dmxCalendar_2.disabled = false;
document.forms[0].FreeTrial.disabled = false;
}
else {
document.forms[0].dmxCalendar_1.disabled = true;
document.forms[0].dmxCalendar_2.disabled = true;
document.forms[0].FreeTrial.disabled = true;
}">
<option value="m" <%If (Not isNull((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then If ("m" = CStr((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Fixed Term Contract</option>
<option value="a" <%If (Not isNull((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then If ("a" = CStr((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Pay as You Go</option>
</select>
</li>
<li>
<label>Start Date <span class="redx">*</span>: </label>
<input type="text" id="dmxCalendar_1" name="dmxCalendar_1" readonly="readonly" />
<script type="text/javascript">
// <![CDATA[
$(function() {$('#dmxCalendar_1').datepicker({
skin : "dmxCalendar",
dateFormat : "M d, yy",
showStatus : true,
numberOfMonths : [1,1],
showAnim : "fadeIn",
showOptions :
{
easing : "easeOutBounce",
direction : "up"
},
duration : "normal",
showOn : "both",
buttonImage : "../Styles/dmxCalendar/calendar_icon.gif",
buttonImageOnly : true,
prompt : ""
});})
// ]]>
</script>
</li><li>
<label>End Date <span class="redx">*</span>: </label>
<input type="text" id="dmxCalendar_2" name="dmxCalendar_2" readonly="readonly" />
<script type="text/javascript">
// <![CDATA[
$(function() {$('#dmxCalendar_2').datepicker({
skin : "dmxCalendar",
dateFormat : "M d, yy",
showStatus : true,
numberOfMonths : [1,1],
showAnim : "fadeIn",
showOptions :
{
easing : "easeOutBounce",
direction : "up"
},
duration : "normal",
showOn : "both",
buttonImage : "../Styles/dmxCalendar/calendar_icon.gif",
buttonImageOnly : true,
prompt : ""
});})
// ]]>
</script>
</li><li>
<label>Free Trial: </label>
<input name="FreeTrial" type="checkbox" id="FreeTrial" value="Y" />
</li>
<li>
<label></label>
<input type="submit" name="update" id="update" value="UPDATE" />
</li>
</ul>
</fieldset>
</form>

In which case, again regardless of the select value, it always tells me that the Start Date and End Date are required, again with none of the fields being disabled.

Sorry mate, but back over to you...

Thank you

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...