Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

FronPage Validation does not work

Hi,

I added validation in FrontPage but I do not see it working.  FrontPage added some webbot and it is commented out.

I did TextBoxValidation/datatype=integer->Datavalue...

How do I add simple validation?  

<!--webbot bot="Validation" S-Display-Name="foooo"
    S-Data-Type="Integer" S-Number-Separators="x" B-Value-Required="TRUE"
    I-Minimum-Length="1" I-Maximum-Length="3"
    S-Validation-Constraint="Greater than or equal to" S-Validation-Value="-35"
    S-Validation-Constraint="Less than or equal to" S-Validation-Value="35" --><input name="duplex_margin" size="3" value="0" maxlength="3">  
    (-35..35)
0
akoifman
Asked:
akoifman
1 Solution
 
webwomanCommented:
Make your own. There are lots of them, they work much better than what FP tries to do.

Go to www.javascriptsource.com see what they have. You WILL need to modify it, and you WILL need to make sure you use it correctly, have it in the right spot, etc. If you're not comfortable editing your code, this is a good time to learn. ;-)

Because like it or not, FrontPage doesn't do lots of things. Some things it does, but badly. If you learn how it's doing what it does (or doesn't do), you can force it to do what YOU want instead of what IT wants. ;-)
0
 
raid999Commented:
This is a the JAVAScript that will check on the form bellow:

<script type="text/javascript">
<!--
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_validateForm() { //v3.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


//-->
</script>

And this is the form:

                  <form action="../servlet/UpdateProfileServlet" onSubmit="MM_validateForm('name','','R','surname','','R','address1','','R','E-mail','','RisEmail','city','','R','post_code','','R','ccard_number','','R');return document.MM_returnValue" method="post">
                    <table align="center">
                      <tr>
                        <td><span class="ntext">Name</span></td>
                        <td>*</td>
                        <td>
                          <input name="name" type="text" maxlength="20" size="20" value="<%=name%>" >
                        </td>
                      </tr>
                      <tr>
                        <td><span class="ntext">Address 1</span></td>
                        <td>*</td>
                        <td>
                          <input name="address1" type="text" maxlength="20" size="20" value="<%=adr1%>" >
                        </td>
                      </tr>
                                <tr>
                        <td><span class="ntext">Address 2</span></td>
                        <td>*</td>
                        <td>
                          <input name="address2" type="text" maxlength="20" size="20" value="<%=adr2%>" >
                        </td>
                      </tr>
                      <tr>
                        <td><span class="ntext">E-mail</span></td>
                        <td>*</td>
                        <td>
                          <input name="email" type="text" maxlength="20" size="20" value="<%=email%>" >
                        </td>
                      </tr>
                     
                      <tr>
                        <td><span class="ntext">Telephone</span></td>
                        <td>*</td>
                        <td>
                          <input name="telephone" type="text" maxlength="20" size="20" value="<%=phone%>" >
                        </td>
                                     <tr>
                        <td><span class="ntext">Password</span></td>
                        <td>*</td>
                        <td>
                          <input name="password" type="password" maxlength="20" size="20" value="<%=pw%>" >
                        </td>
                      </tr>
                     
                      <tr>
                        <td><span class="ntext">Credit Card Type</span></td>
                        <td>*</td>
                        <td> <span class="ntext">
                          <select name="ccard_type" size="1">
                            <option selected value=<%=creditcardtype%>><%=creditcardtype%></option>
                            <option value="VISA">VISA
                            <option value="American Express">American Express
                            <option value="Switch">Switch
                            <option value="Master Card">Master Card
                          </select></span>
                        </td>
                      </tr>
                      <tr>
                        <td><span class="ntext">Credit Card Number</span></td>
                        <td>*</td>
                        <td>
                          <input name="ccard_number" type="text" maxlength="16" size="16" value="<%=credit_card%>" >
                        </td>
                      </tr>
                                <tr>
                        <td><span class="ntext">Credit Card Expiry Date</span></td>
                        <td>*</td>
                        <td>
                          <input name="expiry_date" type="text" maxlength="16" size="16" value="<%=validDate%>" >
                        </td>
                      </tr>
                      <tr>
                        <td colspan=3><span class="ntext">( Fields marked with "*" are compulsory.)</span></td>
                      </tr>
                      <tr>
                        <td colspan=3>
                          <p align="center">
                            <input type="submit" value="Update Profile">
                        </td>
                      </tr>
                    </table>
                  </form>
0
 
__Holly__Commented:
so i c that webwoman is out talking smack about frontpage again...

oh so surprising..

you guys know that she works for the marketing department of macromedia; right??

she gets paid to sit around and talk smack about frontpage all day..

0
 
webwomanCommented:
I wish... you DO notice all the 'I did this in FP and it's not working' messages here, don't you?

FrontPage would be a very nice tool if it worked as advertised. It doesn't. That's not me -- that's all the people here saying that. THEY'RE the ones posting the 'how do I fix this, I did it in FP *AND IT'S NOT WORKING*' messages.

I know enough to FORCE it to do what I want. I got tired of fighting with the software and moved to something else.

FWIW, I don't particularly like DW either -- I'd much rather use HomeSite, so *I* control what's getting generated.

If you know another way to make it work, please let this poor person know. The javascript routine will work, as opposed to FP. ;-)
0
 
coreybryantCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept raid999's comment as answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

coreybryant
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now