[nfbcs] Form validation:
charleseblack at att.net
charleseblack at att.net
Sun Sep 9 01:09:15 UTC 2018
Doesn't the alert function pipe directory to the console?
-----Original Message-----
From: nfbcs <nfbcs-bounces at nfbnet.org> On Behalf Of Aaron Cannon via nfbcs
Sent: Saturday, September 8, 2018 8:39 PM
To: NFB in Computer Science Mailing List <nfbcs at nfbnet.org>
Cc: Aaron Cannon <cannona at fireantproductions.com>
Subject: Re: [nfbcs] Form validation:
In Chrome, press F12, then move to near the top of the window that opens and
select the console tab. You'll find the output lower in the window. You have
a */ in a regular expression that is likely ending the comment early.
Aaron
--
This message was sent from a mobile device
> On Sep 8, 2018, at 19:32, Charles E. Black via nfbcs <nfbcs at nfbnet.org>
wrote:
>
> Most of the code is commented out. My goal now is to get any response.
> I changed it from document.writeline to alert and got the same thing.
> I do not know how to use the alerting tools in crome. I have learned
> enough JavaScript to do my work but am now trying to get any output
> from the browser. Can you tell me how to use the error tools using
> jaws and a crome interface? I feel as if I am missing an important
> piece and it is that piece I am looking for.
>
> -----Original Message-----
> From: nfbcs <nfbcs-bounces at nfbnet.org> On Behalf Of Aaron Cannon via
> nfbcs
> Sent: Saturday, September 8, 2018 8:24 PM
> To: NFB in Computer Science Mailing List <nfbcs at nfbnet.org>
> Cc: Aaron Cannon <cannona at fireantproductions.com>
> Subject: Re: [nfbcs] Form validation:
>
> Are you getting any errors in the console? It looks like most of your
> code is unintentionally commented out. Also, Chrome says that
> document.writeline is not defined.
>
> Aaron
>
>> On 9/8/18, Charles E. Black via nfbcs <nfbcs at nfbnet.org> wrote:
>> Even when I change the code to this, it will still not give me the
>> alert
>> message:
>>
>> <!DOCTYPE html>
>> <html>
>> <head>
>> <meta charset="utf-8" />
>> <title>App1</title>
>> <link href="css/default.css" rel="stylesheet" />
>>
>>
>>
>>
>> <script type="text/javascript">
>>
>>
>> /*
>> function MM_findObj(n, d) { //v4.01
>>
>> 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);
>>
>> if (!x && d.getElementById) x = d.getElementById(n);
>> return x;
>>
>> }
>>
>> */
>>
>> function YY_checkform() {
>> document.writeline("This works");
>> }
>> /*
>> //copyright (c)1998,2002 Yaromat.com
>>
>> var args = YY_checkform.arguments;
>> var myDot = true;
>> var myV = '';
>> var myErr = '';
>> var addErr = false;
>> var myReq;
>>
>> for (var i = 1; i < args.length; i = i + 4) {
>>
>> if (args[i + 1].charAt(0) == '#') {
>> myReq = true;
>> args[i + 1] = args[i + 1].substring(1);
>> } else {
>> myReq = false
>> }
>>
>> if (myReq == true) {
>> document.write("true");
>> }
>> }
>> }
>>
>> var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,
>> ""));
>>
>> myV = myObj.value;
>>
>> if (myObj.type == 'text' || myObj.type == 'password'
>> || myObj.type == 'hidden')
>> {
>>
>> if (myReq && myObj.value.length == 0)
>> {
>> addErr = true
>> }
>>
>> if ((myV.length > 0) && (args[i + 2] == 1)) {
>>
>> //fromto
>>
>> var myMa = args[i + 1].split('_');
>> if (isNaN(myV) || myV < myMa[0] / 1 || myV >
>> myMa[1] / 1) { addErr = true }
>>
>> }
>> else if ((myV.length > 0) && (args[i + 2] == 2)) {
>>
>> var rx = new
>> RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");
>> if (!rx.test(myV)) addErr = true;
>>
>> }
>> else if ((myV.length > 0) && (args[i + 2] == 3))
>> { // date
>>
>> var myMa = args[i + 1].split("#");
>> var myAt = myV.match(myMa[0]);
>>
>> if (myAt)
>> {
>> var myD =
>> (myAt[myMa[1]]) ? myAt[myMa[1]] : 1;
>> var myM = myAt[myMa[2]] - 1;
>> var myY = myAt[myMa[3]];
>> var myDate =
>> new Date(myY, myM, myD);
>> if
>> (myDate.getFullYear() != myY || myDate.getDate() != myD ||
>> myDate.getMonth()
>> != myM)
>> {
>> addErr
>> = true
>> };
>>
>> }
>> else { addErr = true }
>>
>> }
>>
>> else if ((myV.length > 0) && (args[i + 2] == 4))
>> { // time
>>
>> var myMa = args[i + 1].split("#");
>> var myAt = myV.match(myMa[0]); if (!myAt) {
>> addErr = true }
>>
>> }
>>
>> else if (myV.length > 0 && args[i + 2] == 5) { //
>> check this 2
>>
>> var myObj1 = MM_findObj(args[i +
>> 1].replace(/\[\d+\]/ig, ""));
>>
>> if (myObj1.length)
>> myObj1 =
>> myObj1[args[i + 1].replace(/(.*\[)|(\].*)/ig, "")];
>>
>> if (!myObj1.checked)
>> {
>> addErr = true
>> }
>>
>> }
>>
>> else if (myV.length > 0 && args[i + 2] == 6)
>> { // the same
>> var myObj1 =
>> MM_findObj(args[i + 1]);
>>
>> if (myV != myObj1.value)
>> {
>> addErr = true
>> }
>>
>> }
>>
>> }
>>
>> else
>>
>> if (!myObj.type && myObj.length > 0 &&
>> myObj[0].type ==
>> 'radio')
>>
>> {
>>
>> var myTest =
>> args[i].match(/(.*)\[(\d+)\].*/i);
>>
>> var myObj1 = (myObj.length > 1) ?
>> myObj[myTest[2]]
>> :
>> myObj;
>>
>> if (args[i + 2] == 1 && myObj1 &&
>> myObj1.checked && MM_findObj(args[i + 1]).value.length / 1 == 0)
>>
>> {
>> addErr = true
>> }
>>
>> if (args[i + 2] == 2)
>>
>> {
>>
>> var myDot = false;
>>
>> for (var j = 0; j < myObj.length; j++)
>> {
>> myDot = myDot || myObj[j].checked
>> }
>>
>> if (!myDot)
>>
>> {
>>
>> myErr += '* ' + args[i + 3] + '\n'
>>
>> }
>>
>> }
>>
>> }
>>
>> else if (myObj.type == 'checkbox')
>>
>> {
>>
>> if (args[i + 2] == 1 && myObj.checked ==
>> false)
>>
>> {
>>
>> addErr = true
>> }
>>
>> if (args[i + 2] == 2 && myObj.checked &&
>> MM_findObj(args[i + 1]).value.length / 1 == 0)
>>
>> {
>> addErr = true
>>
>> }
>>
>> }
>>
>> else if (myObj.type == 'select-one' || myObj.type
>> ==
>> 'select-multiple') {
>>
>> if (args[i + 2] == 1 && myObj.selectedIndex /
>> 1 ==
>> 0)
>>
>> {
>>
>> addErr = true
>> }
>>
>> }
>>
>> else if (myObj.type == 'textarea')
>> {
>>
>> if (myV.length < args[i + 1])
>> { addErr = true }
>>
>> }
>>
>> if (addErr) { myErr += '* ' + args[i + 3] + '\n';
>> addErr = false }
>>
>> // window.close();
>>
>> }
>>
>> if (myErr != '') { alert('The required information is
>> incomplete or contains errors:\t\t\t\t\t\n\n' + myErr) }
>>
>> // document.MM_returnValue = (myErr == '');
>>
>> }
>> */
>> //-->
>>
>> </script>
>>
>> </head>
>> <body>
>> <div>
>>
>> <form name="form1" method="post"
>> onsubmit="YY_checkform('form1','DateTaken','#q','0','Please enter a
>> valid date \(mm/dd/yy\).');return document.MM_returnValue; " >
>> <input id="DateTaken" type="text" />
>>
>> <input id="Submit1" type="submit" value="submit"
>> />
>> </form>
>>
>>
>> </div>
>>
>>
>> </body>
>> </html>
>>
>> -----Original Message-----
>> From: nfbcs <nfbcs-bounces at nfbnet.org> On Behalf Of Aaron Cannon via
>> nfbcs
>> Sent: Saturday, September 8, 2018 7:55 PM
>> To: NFB in Computer Science Mailing List <nfbcs at nfbnet.org>
>> Cc: Aaron Cannon <cannona at fireantproductions.com>
>> Subject: Re: [nfbcs] Form validation:
>>
>> Hi.
>>
>> Yes, I have experience with this. How can I help?
>>
>> Feel free to reach out to me directly at
>> cannona at fireantproductions.com if you would like.
>>
>> Aaron
>>
>> --
>> This message was sent from a mobile device
>>
>>
>>> On Sep 8, 2018, at 18:48, Charles E. Black via nfbcs
>>> <nfbcs at nfbnet.org>
>> wrote:
>>>
>>> Does anyone know anything about form validation using JavaScript. I
>>> am having a struggle with this one form and would like to speak with
>>> someone concerning it. Thanks!
>>>
>>>
>>> _______________________________________________
>>> nfbcs mailing list
>>> nfbcs at nfbnet.org
>>> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
>>> To unsubscribe, change your list options or get your account info
>>> for
>> nfbcs:
>>> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/cannona%40fireant
>>> p
>>> r
>>> oductions.com
>>
>> _______________________________________________
>> nfbcs mailing list
>> nfbcs at nfbnet.org
>> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
>> To unsubscribe, change your list options or get your account info for
>> nfbcs:
>> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/charleseblack%40at
>> t
>> .net
>>
>>
>> _______________________________________________
>> nfbcs mailing list
>> nfbcs at nfbnet.org
>> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
>> To unsubscribe, change your list options or get your account info for
>> nfbcs:
>> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/cannona%40fireantp
>> r
>> oductions.com
>>
>
> _______________________________________________
> nfbcs mailing list
> nfbcs at nfbnet.org
> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
> To unsubscribe, change your list options or get your account info for
nfbcs:
> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/charleseblack%40att
> .net
>
>
> _______________________________________________
> nfbcs mailing list
> nfbcs at nfbnet.org
> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
> To unsubscribe, change your list options or get your account info for
nfbcs:
> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/cannona%40fireantpr
> oductions.com
_______________________________________________
nfbcs mailing list
nfbcs at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
To unsubscribe, change your list options or get your account info for nfbcs:
http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/charleseblack%40att.net
More information about the NFBCS
mailing list