Log in

View Full Version : Blank fields



stealthmode666
12-04-2008, 10:31 PM
I have a form that doesn't need every field filled in. Can I ask for a script that checks the blank fields and inserts something. The fields are integer, currency, character etc. All have severe validation by spry widgets applied to them by me, I need the data as the widget allows only to stop users inserting things in wrong format.

NOTICE:Undefined index in......... happens when a field is left blank.
either .php script to add to my script or javascript.

Don't assume I know how to write scripts because I don't yet, very new and a mountain to climb this end, so if helping me with this, bear with me, as I got a big set of "L" plates on me.
I asked in another forum and all I got was yes you can add script to check this but no help to say or show me!!
I'm looking for the actual script.
I can post my script i'm using to extract the data if someone wants.

stealthmode666
12-05-2008, 04:37 AM
What you have written is absolute gibberish.

With attitude and comments like this towards others who ask for help is not very nice is it?
It explains what I ask in readable terms.
I am asking for .php code that checks the fields and inserts something so I don't get a page of NOTICE:Undefined indexes../ due to some fields in my form not getting filled by the user.
Don't use this post or forum to vet your anger on people

rubing
12-05-2008, 05:08 AM
You could use the isset() function to check if a $_POST array member is undefined and then assign it a default value.

something like
if (!isset($_POST['currency']))
$_POST['currency']=FALSE;

Snookerman
12-05-2008, 08:03 AM
No dude you're writing really does suck....you should take some english classes otherwise you're not going to get very far in life.

Please be nice to the other members. If you don't understand what someone needs help with, ask for a more detailed explanation or go to a different forum. Nobody forces you to respond to any posts.

ddadmin
12-05-2008, 09:28 AM
Rubing, flaming is definitely not allowed here. Please treat others with respect. If you can't understand what someone is saying, you have two choices- 1) Ask for clarification nicely, or 2) Simply don't respond. Regardless, there is no justification for insulting someone, and I point you to 1.1 in our Rules (http://www.dynamicdrive.com/forums/rules.htm) again as a reminder.

Deleting the flame/ related posts.

rubing
12-05-2008, 02:34 PM
Yeah, you're right I was little mean. I had a tough day and then reading that incoherent question just broke the camels back. Really, though I'm not surprised when the guy said that nobody could answer his question. The OP should read the following http://linuxmafia.com/faq/Essays/smart-questions.html

It is obvious he did not even do a simple google search.

stealthmode666
12-06-2008, 02:56 PM
I got my form working perfectly.
I went down a different road.
I used server-side JavaScript to check the form fields on submit for blank fields and got JavaScript to insert a blank space on any missing fields on the form. [Value =” “]
Now the form will only be sent when JavaScript has checked and amended the fields thus allowing the .PHP script to send the email and show the thank-you header. (With-out any notices or warnings on the next page after submit).
Thanks all who offered me help on this. We all have to learn somewhere.