Results 1 to 7 of 7

Thread: Blank fields

  1. #1
    Join Date
    Dec 2008
    Posts
    20
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Blank fields

    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.

  2. #2
    Join Date
    Dec 2008
    Posts
    20
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by rubing View Post
    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

  3. #3
    Join Date
    Nov 2008
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    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;
    Last edited by ddadmin; 12-05-2008 at 09:29 AM.

  4. The Following User Says Thank You to rubing For This Useful Post:

    stealthmode666 (12-05-2008)

  5. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by rubing View Post
    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.
    Last edited by Snookerman; 12-05-2008 at 09:59 PM.

  6. The Following User Says Thank You to Snookerman For This Useful Post:

    stealthmode666 (12-05-2008)

  7. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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 again as a reminder.

    Deleting the flame/ related posts.
    DD Admin

  8. The Following User Says Thank You to ddadmin For This Useful Post:

    stealthmode666 (12-05-2008)

  9. #6
    Join Date
    Nov 2008
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    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.

  10. #7
    Join Date
    Dec 2008
    Posts
    20
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Smile Working beautifully

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •