From ashaw at polymerdb.org Wed May 2 12:00:37 2007 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] IE 7 List style type bug In-Reply-To: References: Message-ID: <4638B5A5.10006@polymerdb.org> Joshua Glenn wrote: > Hi Allen, > > For some reason or other i didn't receive your response to my email > thru the list, but did see it when i went to the archives on the > nyphp.org site and just wanted to drop you a note of thanks for > responding. I have no idea what's up with this xp box. > No problem, Josh. You know it just occurred to me: doesn't IE have a feature that allows the user to configure their own default style sheets? Did you check (Tools>Options [General Tab] [Accessibility Button]) to see if there is some default style sheet specified for IE on that machine? - A. -- Allen Shaw Polymer (http://polymerdb.org) slidePresenter (http://slides.sourceforge.net) From cliff at pinestream.com Tue May 22 09:25:07 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question Message-ID: <20070522131909.M99196@pinestream.com> I am building a JS validation class, but have hit a stumbling block. I attach a generic onsubmit handler to the form, which then processes the validation set. But...how can I access the validation set? Each form's validation set was set up as a separate object, but the onsubmit handler only "sees" its own form object. I'd rather not hardwire the onsubmit handler to each form. One though was to add each validation set to the respective form object. But I don't know if it's kosher to add properties to form elements. Is it? If so, this would be an easy way to handle the validation set. Cliff From mwithington at PLMresearch.com Tue May 22 09:37:40 2007 From: mwithington at PLMresearch.com (Mark Withington) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <20070522131909.M99196@pinestream.com> References: <20070522131909.M99196@pinestream.com> Message-ID: <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> Cliff, Not my strong suit, but have you tried setting the form elements up as an associative array rather than a bunch of key-value pairs? [I think] this will allow your handler to walk through the array appropriately. Alternatively, you can cheat (like I usually do) and use someone else's validator like fValidator.js On 5/22/07, Cliff Hirsch wrote: > > I am building a JS validation class, but have hit a stumbling block. I > attach > a generic onsubmit handler to the form, which then processes the > validation set. > > But...how can I access the validation set? Each form's validation set was > set > up as a separate object, but the onsubmit handler only "sees" its own form > object. > > I'd rather not hardwire the onsubmit handler to each form. One though was > to > add each validation set to the respective form object. But I don't know if > it's kosher to add properties to form elements. Is it? If so, this would > be an > easy way to handle the validation set. > > Cliff > _______________________________________________ > New York PHP SIG: Front End Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/front-end > http://www.nyphp.org > -- Mark -------------------------- Mark L. Withington PLMresearch PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 AIM/MSN/Skype: PLMresearch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lists.nyphp.org/pipermail/front-end/attachments/20070522/9ca88c64/attachment.html From cliff at pinestream.com Tue May 22 10:04:20 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> Message-ID: <20070522140003.M83741@pinestream.com> I'll take a look at fValidator.js. I modeled my class off something I found on the net, but need to hack it up -- a lot. but I think I got it. Just need a JavaScript guru to show me how to reference an object when the object name is a variable. function form_submit_handler() { ?????? // Get the form name ?????? var formName = this.name; ?????? ?????? // Get the reference to the global validation object, which is called the form name ?????? val validationSet = $$formName; *** I need the Javascript equivalent of $$ to get the reference to the object. *** On Tue, 22 May 2007 09:37:40 -0400, Mark Withington wrote > Cliff, > > Not my strong suit, but have you tried setting the form elements up as an associative array rather than a bunch of key-value pairs???[I think] this will allow your handler to walk through the array appropriately.??Alternatively, you can cheat (like I usually do) and use someone else's validator like fValidator.js > > On 5/22/07, Cliff Hirsch wrote:I am building a JS validation class, but have hit a stumbling block. I attach > a generic onsubmit handler to the form, which then processes the validation set. > > But...how can I access the validation set? Each form's validation set was set > up as a separate object, but the onsubmit handler only "sees" its own form object. > > I'd rather not hardwire the onsubmit handler to each form. One though was to > add each validation set to the respective form object. But I don't know if > it's kosher to add properties to form elements. Is it? If so, this would be an > easy way to handle the validation set. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lists.nyphp.org/pipermail/front-end/attachments/20070522/b549c681/attachment.html From chsnyder at gmail.com Tue May 22 10:31:37 2007 From: chsnyder at gmail.com (csnyder) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <20070522140003.M83741@pinestream.com> References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> Message-ID: On 5/22/07, Cliff Hirsch wrote: > > I'll take a look at fValidator.js. I modeled my class off something I found > on the net, but need to hack it up -- a lot. but I think I got it. Just need > a JavaScript guru to show me how to reference an object when the object name > is a variable. > > function form_submit_handler() { > // Get the form name > var formName = this.name; > > // Get the reference to the global validation object, which is called > the form name > val validationSet = $$formName; > > *** I need the Javascript equivalent of $$ to get the reference to the > object. *** > Like forms[ formName ] ? You could also give the form an id attribute that's the same as the name, and reference getElementById( formName ). -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Tue May 22 10:33:37 2007 From: chsnyder at gmail.com (csnyder) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> Message-ID: On 5/22/07, csnyder wrote: > > function form_submit_handler() { > > // Get the form name > > var formName = this.name; > > > > // Get the reference to the global validation object, which is called > > the form name > > val validationSet = $$formName; > > > > *** I need the Javascript equivalent of $$ to get the reference to the > > object. *** > > > > Like forms[ formName ] ? > > You could also give the form an id attribute that's the same as the > name, and reference getElementById( formName ). > And since I'm not a guru, I forgot about getElementsByName()... http://developer.mozilla.org/en/docs/DOM:document.getElementsByName From cliff at pinestream.com Tue May 22 10:37:28 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> Message-ID: <20070522143231.M29158@pinestream.com> On Tue, 22 May 2007 10:31:37 -0400, csnyder wrote > On 5/22/07, Cliff Hirsch wrote: > > > > I'll take a look at fValidator.js. I modeled my class off something I found > > on the net, but need to hack it up -- a lot. but I think I got it. Just need > > a JavaScript guru to show me how to reference an object when the object name > > is a variable. > > > > function form_submit_handler() { > > // Get the form name > > var formName = this.name; > > > > // Get the reference to the global validation object, which is called > > the form name > > val validationSet = $$formName; > > > > *** I need the Javascript equivalent of $$ to get the reference to the > > object. *** > > > > Like forms[ formName ] ? > > You could also give the form an id attribute that's the same as the > name, and reference getElementById( formName ). > > -- > Chris Snyder > http://chxo.com/ I'm trying to access a different global object, not elements in the form. Unless of course I chose to store the validation parameters in the form object. I figured this out to reference the object via a variable variable: PHP: $valset = $$this.name; Javascript: var valset = eval(this.name); This allows me to access an object that has the same name as the form. But I hate eval -- opens up a security hole. I limit exposure by only processing the statement if the form name is say under ten characters -- seems reasonable. From lists at enobrev.com Tue May 22 10:52:10 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <20070522131909.M99196@pinestream.com> References: <20070522131909.M99196@pinestream.com> Message-ID: <001701c79c80$c76217b0$6400a8c0@enobrev> > [mailto:front-end-bounces@lists.nyphp.org] On Behalf Of Cliff Hirsch > I'd rather not hardwire the onsubmit handler to each form. > One though was to add each validation set to the respective > form object. But I don't know if it's kosher to add > properties to form elements. Is it? If so, this would be an > easy way to handle the validation set. Any chance you can show more code samples? What does a validation set look like? How's the class(es) written? Are you looping through the form elements or validating them by name / id? Mark From chsnyder at gmail.com Tue May 22 10:52:39 2007 From: chsnyder at gmail.com (csnyder) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <20070522143231.M29158@pinestream.com> References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> <20070522143231.M29158@pinestream.com> Message-ID: On 5/22/07, Cliff Hirsch wrote: > I'm trying to access a different global object, not elements in the form. > Unless of course I chose to store the validation parameters in the form object. Oh, my bad. Okay, how about window[ globalVariableName ] ? If that doesn't work I'll stop with the suggestions. FYI, eval seems pretty safe in this context, since you are in control of the form names. -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Tue May 22 11:06:54 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> <20070522143231.M29158@pinestream.com> Message-ID: <20070522150249.M55286@pinestream.com> On Tue, 22 May 2007 10:52:39 -0400, csnyder wrote > On 5/22/07, Cliff Hirsch wrote: > > > I'm trying to access a different global object, not elements in the form. > > Unless of course I chose to store the validation parameters in the form object. > > Oh, my bad. Okay, how about window[ globalVariableName ] ? > > If that doesn't work I'll stop with the suggestions. > Keep suggesting. Dang, as we don't say in Boston, you are good. I tested: var formName = this.name; if(formName.length > 10) // paranoia check return false; var valset = eval(this.name); alert (valset.test); alert (window[this.name]); alert (window[this.name].test); Sure enough window[this.name] references the same object as eval(this.name) Brilliant. From cliff at pinestream.com Tue May 22 11:16:49 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <001701c79c80$c76217b0$6400a8c0@enobrev> References: <20070522131909.M99196@pinestream.com> <001701c79c80$c76217b0$6400a8c0@enobrev> Message-ID: <20070522151229.M49836@pinestream.com> On Tue, 22 May 2007 10:52:10 -0400, Mark Armendariz wrote > Any chance you can show more code samples? What does a validation > set look like? How's the class(es) written? Are you looping > through the form elements or validating them by name / id? > > Mark I'm still writing the class. I could loop through form elements and validate using validation parameters embedded in the html like fvaldiator, or set as properties in the form object. But I am choosing to have a separate object that will store all validation parameters -- sort of like htmlquickform. Then I can just loop through the validation set. My trouble was accessing this object, but Chris' window[globalvariable] did the trick. Seems like 9 times out of ten, eval is not necessary. From mwithington at PLMresearch.com Tue May 22 11:34:57 2007 From: mwithington at PLMresearch.com (Mark Withington) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <20070522150249.M55286@pinestream.com> References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> <20070522143231.M29158@pinestream.com> <20070522150249.M55286@pinestream.com> Message-ID: <491198290705220834o6c946b08x29681a76c2fad114@mail.gmail.com> Boston translation: "Wicked pissah!" On 5/22/07, Cliff Hirsch wrote: > > On Tue, 22 May 2007 10:52:39 -0400, csnyder wrote > > On 5/22/07, Cliff Hirsch wrote: > > > > > I'm trying to access a different global object, not elements in the > form. > > > Unless of course I chose to store the validation parameters in the > form > object. > > > > Oh, my bad. Okay, how about window[ globalVariableName ] ? > > > > If that doesn't work I'll stop with the suggestions. > > > Keep suggesting. Dang, as we don't say in Boston, you are good. > > I tested: > > var formName = this.name; > if(formName.length > 10) // paranoia check > return false; > var valset = eval(this.name); > > alert (valset.test); > alert (window[this.name]); > alert (window[this.name].test); > > Sure enough window[this.name] references the same object as eval(this.name > ) > > Brilliant. > _______________________________________________ > New York PHP SIG: Front End Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/front-end > http://www.nyphp.org > -- Mark -------------------------- Mark L. Withington PLMresearch PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 AIM/MSN/Skype: PLMresearch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lists.nyphp.org/pipermail/front-end/attachments/20070522/a93e92a4/attachment.html From applegreentree at gmail.com Tue May 22 11:46:15 2007 From: applegreentree at gmail.com (Katherine P) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] customizing input box; submitting the form Message-ID: <45e97c380705220846pa5ed715xc88326107797bdf4@mail.gmail.com> Greetings: Relative newbie, here, and creating a form w/php. How do I customize the width of the input box? And how do I know if this is submiting the changes to the database, not just the browser? (So far I don't get that ok message). I appreciate anyone's help - thanks, here's my php file named admin.php...

Your changes were saved successfully
-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lists.nyphp.org/pipermail/front-end/attachments/20070522/38ee3b87/attachment.html From chsnyder at gmail.com Tue May 22 11:46:59 2007 From: chsnyder at gmail.com (csnyder) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript Form onsubmit question In-Reply-To: <20070522150249.M55286@pinestream.com> References: <20070522131909.M99196@pinestream.com> <491198290705220637w533f3dd2u5a415918f74426dc@mail.gmail.com> <20070522140003.M83741@pinestream.com> <20070522143231.M29158@pinestream.com> <20070522150249.M55286@pinestream.com> Message-ID: On 5/22/07, Cliff Hirsch wrote: > Sure enough window[this.name] references the same object as eval(this.name) > > Brilliant. When you create a "global" object, you're really just appending a new object to window. Same goes for any functions you create in the global scope. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Tue May 22 11:59:05 2007 From: chsnyder at gmail.com (csnyder) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] customizing input box; submitting the form In-Reply-To: <45e97c380705220846pa5ed715xc88326107797bdf4@mail.gmail.com> References: <45e97c380705220846pa5ed715xc88326107797bdf4@mail.gmail.com> Message-ID: On 5/22/07, Katherine P wrote: > Greetings: > > Relative newbie, here, and creating a form w/php. > How do I customize the width of the input box? Using the HTML size attribute is the simplest way. Using the CSS width property is the best way. > And how do I know if this is submiting the changes to the database, not just > the browser? (So far I don't get that ok message). > I appreciate anyone's help - thanks, here's my php file named admin.php... Your script only selects items from the database, it doesn't make any changes. Are you taking a class on programming? Or working from a book? Either of those things will help much more at this point in your newbiedom than asking for free help on this list. -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Wed May 23 04:06:26 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue Mar 4 07:24:12 2008 Subject: [front-end] JavasScript onsubmit question, now square bracket notation In-Reply-To: <20070523080042.M28143@pinestream.com> Message-ID: >>> I'm trying to access a different global object, not elements in the form. >>> Unless of course I chose to store the validation parameters in the form > object. >> >> Oh, my bad. Okay, how about window[ globalVariableName ] ? >> > Sure enough window[this.name] references the same object as eval(this.name) > > Brilliant. For anyone that has been following this thread and goes a bit batty with JavaScript's dot versus square bracket notation, this is a good quick read. And it mentions exactly the global variable access method that Chris pointed out. http://www.jibbering.com/faq/faq_notes/square_brackets.html Cliff