fredrikrob Posted April 22, 2012 Share Posted April 22, 2012 Hi, I am working on simple project and it's for the institute Class project where i am learning php. i have to submit the project as soon as possible. But i am doing it different way then of i was supposed. Instead of validation message i want to use a picture or icon with Red error icon and Green yes icon as you can check in the attached picture. I am calling a function on submit button and if there is any error then using document.GetElementById('error').style.background="none" and ="pic url". I am getting output but it's just for a second then disappeared. I have already attached the Screen Shot to get the full idea. Quote Link to comment https://forums.phpfreaks.com/topic/261423-form-validation-issue/ Share on other sites More sharing options...
.josh Posted April 22, 2012 Share Posted April 22, 2012 kinda hard to help you without seeing any code... but if I had to guess, your icon swapping function sounds like it is working but your form is submitting anyways. IOW you're forgetting to return false somewhere, to block it from actually submitting. And I can only guess (again, no code posted) that you have a single form script that submits to itself and it's just outputting the original form again because of some server-side logic telling it to do it if form has not been filled out. Quote Link to comment https://forums.phpfreaks.com/topic/261423-form-validation-issue/#findComment-1339646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.