Tuesday, March 11, 2008

week 9 post

After having nearly completed the client-side validation for the large resume form we have on the facebook application - using javascript - when it came to testing time on facebook, it didn't work. Facebook markup language did not allow for many of the javascript functions to work, such as get document.by.element.id, and so ultimately those many hours of calling different functions was in vain. Luckily, however, the server side validation with PHP was not too hard to implement. At first I attempted to use this tutorial: http://www.onlamp.com/pub/a/php/2004/04/22/php_css_forms.html?page=2
to have the php page submit to itself, and begin validation only after the submit button was pressed, thus allowing for the validation to take place all in one page. However, it turns out that embedding php into id classes and id values within the form caused the whole form not to show up when uploaded onto our fileserver. Thus, even though this route seemed promising in its intuitiveness, I chose to go with a different route. Now upon "submitting" I am having the validation take place on another php file which "Gets" the data. I am also using !eregi to validate for things such as names, phone numbers, addresses, and I am using if(empty) to see if the fields are empty. The final step is to figure out how I will send the validated information through to the original php file that it was intended to go to in the first place.

No comments: