Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    London, Ontario, Ontario, Canada
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FrontPage Form Manipulation (Frontpage 2000)

    I have a text form that validates numerically, restricting data entry to a value greater than or equal to "1997". If the user enters a restricted value (say, "1995"), Frontpage burps an alert warning stating that the value needs to be greater than or equal to "1997". That's fine, but the text box represents a date and I would like to manipulate the alert box by changing the text (something like "The model year you have entered is too old to qualify for this contract." or something to that affect). Is it possible to change the text in this alert box?

    ref: http://www.thewarrantypeople.com/sec...bumper-app.htm

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FrontPage Form Manipulation (Frontpage 2000)

    I could get thru' on your link, I'm afraid.

    But - I just had a quick play.
    If you view source of your published page, you will see the full script on the page which (I assume) the FP Server Extensions 'publish' on your behalf.
    I made a quick single entry form, published it, grabbed the code produced, and brought it back into FP and entered it directly into the HTML page. ie. I think you are going to have to do it the long way or put up with what FP thinks you want to say.

    Try this - it may help you see a way round the problem:<pre><html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 2</title>
    <SCRIPT LANGUAGE="JavaScript">
    function FrontPage_Form1_Validator(theForm)
    {

    var checkOK = "0123456789-,";
    var checkStr = theForm.T1.value;
    var allValid = true;
    var decPoints = 0;
    var allNum = "";
    for (i = 0; i < checkStr.length; i++)
    {
    ch = checkStr.charAt(i);
    for (j = 0; j < checkOK.length; j++)
    if (ch == checkOK.charAt(j))
    break;
    if (j == checkOK.length)
    {
    allValid = false;
    break;
    }
    if (ch != ",")
    allNum += ch;
    }
    if (!allValid)
    {
    alert("Please enter only digit characters in the "T1" field.");
    theForm.T1.focus();
    return (false);
    }

    var chkVal = allNum;
    var prsVal = parseInt(allNum);
    if (chkVal != "" && !(prsVal >= "1997"))
    {
    <font color=red> alert("The model year you have entered is too old to qualify for this contract.");</font color=red>
    theForm.T1.focus();
    return (false);
    }
    return (true);
    }
    </SCRIPT>
    </head>

    <body>

    <form method="POST" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
    <input type="text" name="T1" size="20"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>

    </html></pre>


    You may find this example here at <A target="_blank" HREF=http://javascript.internet.com/forms/val-info.html>JavaScript</A> a help. I probably can't - I'm theoretically on holiday <img src=/S/smile.gif border=0 alt=smile width=15 height=15> . . .

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: FrontPage Form Manipulation (Frontpage 2000)

    holidays! <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •