Jump to content

Form Validation issue.


fredrikrob

Recommended Posts

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.

index.php?action=dlattach;topic=358205.0;attach=18161;image

post-127764-13482403437873_thumb.jpg

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.