![]() |
| ||
| small error when submitting form hello ive got a sign in page it works and sends data to database but soon as i had validation code for an email address using java, and then when i click submit it comes up with this error below for every textbox even though all the textboxes have data entered in them this error appears when the form is submitted... any ideas what could be causing this Notice: Undefined index: StudentName in /home/stud/1/0472547/public_html/Signupcomplete.php on line 49 <form name="f1" method="post" action="Signupcomplete.php" onSubmit="return Validate()" enctype = text/plain> <p><input type="submit" name="Submit" value="Sign Up"></td> |
| ||
| Re: small error when submitting form java or javascript? It's hard to tell, since you aren't showing us your javascript.... but,... I would say your "Validate" is somehow over riding everything. You may be trying to pass the information from these fields via javascript to php, this isn't impossible, it's just tricky... Your best bet is to force the validate before the submit.. for instance, most people will have to focus on the submit button so, force the running of "validate to happen onFocus of the submit button. This will ensure that if all fields aren't proper, they won't be able to click submit, but, if all is good, it will validate and they will be able to push the button.. Just a guess as I can't see your code. Sage |
| ||
| Re: small error when submitting form OK, I'm pasting the code you IMd me here, because there are others who may be able to help with this as well. <script src="signupcheck.js" language="JavaScript" type="text/javascript"> Some ideas here... The function that you really want to call is CheckMyUsername because Validate is not really pushing the information that you want it to, and you can handle everything within the CheckMyUsername function anyway. This, I believe is where your code is breaking. after each line you need a ";" I have added these in your code above for you. To be honest, this depends on what browser you are using.. IE7 doesn't care about this, but it is still good practice regardless. I believe (if I am not mistaken) that your variables need to be declared as such... so, where you have variables you need to type var foo = "bar"; one thing that you should do after each step run an alert just to see where you are breaking... I also think you need to put the function call on the button itself and make it an on focus event, or onmousedown that triggers the function call and not onsubmit. Hope this helps Sage |
| ||
| Re: small error when submitting form hello still dont work but ive noticed the data still gets input to the database but that notice keeps appearing the only data that dont get entered is the username because its got javascript dont understand what the problem could be... |
| ||
| Re: small error when submitting form The error is in your PHP. You are missing this: $StudentName = $_POST['StudentName']; Matti Ressler Suomedia |
| ||
| Re: small error when submitting form but ive got that code in my php, when i take the vaildation off for email everything works, its just when i add that javascript the notices come up cheers |
| ||
| Re: small error when submitting form This is a PHP error, not a javascript error. Your error message tells EXACTLY where the problem is: Notice: Undefined index: StudentName in /home/stud/1/0472547/public_html/Signupcomplete.php on line 49 Line 49. Please post the code in this file. Matti Ressler Suomedia |
| ||
| Re: small error when submitting form <? |
| ||
| Re: small error when submitting form Thats only 17 lines :icon_frown: How about attaching the actual whole file? - Signupcomplete.php Matti Ressler Suomedia |
| All times are GMT -4. The time now is 3:45 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC