studgate Posted September 24, 2014 Share Posted September 24, 2014 Hey guys, Thank you in advance... here is my situation, I have a form with three (3) fields in it, the 'student name' is unlimited textfield with an "add more" button to it and I have two select fields ('number of shirts' and 'trophies') that depend on the number of entries for 'student name'... I want to create the select fields based on this math, for as many 'student name' entries: 1- i want to have the select form for 'number of shirts' to be 0 up to that number... so if there are 6 'student name' entries, the select options will be 0,1,3,4,5,6,7 2- I want to have the select form for 'trophies' to be 5 'student name' entries to 1 'trophies', for example if there are 6 'student name' entries, the select options will be 0,1... if there are 13 entries, options will be 0,1,2... So if there are less than 5 'student name' entries, the select field will not show (hidden) of course if there are no 'student name' entries, these two fields won't show up (hidden) let me know if that make sense and ANY help or directions will be GREATLY APPRECIATED. Thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/ Share on other sites More sharing options...
ginerjm Posted September 24, 2014 Share Posted September 24, 2014 1 - what is an 'unlimited textfield'? 2 - what is a 'select field'? You show examples of how you want some (input?) fields to be dependent on other fields, yet your 'rules' for those dependencies make no sense. For ex, you say 'so if there are 6 'student name' entries, the select options will be 0,1,3,4,5,6,7'. Why "1,3,4,5,6,7" and not "1,2,3,4,5,6"? Perhaps you just need to re-read your post and try again? Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492001 Share on other sites More sharing options...
studgate Posted September 24, 2014 Author Share Posted September 24, 2014 (edited) that clearly was a typo ginerjm, thanks for capturing it ... it supposed to be 0,1,2,3,4,5,6 as you mentioned! the reason for the zero is they can select none and we need to record it It was also suppose to be unlimited input textfield (find demo here: http://jsfiddle.net/studgate/tqj8bxdh/), this is without the other SELECT fields thanks! Edited September 24, 2014 by studgate Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492003 Share on other sites More sharing options...
ginerjm Posted September 24, 2014 Share Posted September 24, 2014 You need to be specific about your use of terms. Are we talking about "input" fields or "select" fields? Very confusing. How about deciding on your terms and re-posting your question. Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492004 Share on other sites More sharing options...
studgate Posted September 25, 2014 Author Share Posted September 25, 2014 are you kidding? read this and tell me which part you don't understand Thank you in advance... here is my situation, I have a form with three (3) fields in it, the 'student name' is unlimited textfield with an "add more" button to it and I have two select fields ('number of shirts' and 'trophies') that depend on the number of entries for 'student name'... Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492016 Share on other sites More sharing options...
ginerjm Posted September 25, 2014 Share Posted September 25, 2014 (edited) You're being rude to a guy who is trying in the worst way to understand your vague technical details ( at least they are supposed to be technical details) and wondering what you are talking about? What the H... is "unlimited textfields"? Is that some new html tag that I don't know about? What is a "select field"? Is that a field for input aka - 'input' or is that an html "select" field? Your very loose usage of programming terms is making your English request for help hard to fathom. Is that clear to you? Edited September 25, 2014 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492020 Share on other sites More sharing options...
Psycho Posted September 25, 2014 Share Posted September 25, 2014 (edited) I think I understand the select fields to be just that - HTML select fields. However, I too am perplexed by what is meant by an "unlimited text field with an 'add more' option". Never heard of such a thing. And, if the field is "unlimited" what is the purpose of an "add more" option? In any event, it sounds like you want a JavaScript solution, not PHP. If so, this is in the wrong forum. Edited September 25, 2014 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492024 Share on other sites More sharing options...
studgate Posted September 25, 2014 Author Share Posted September 25, 2014 Thanks Psycho, I always thought this board to be advanced so I was explaining it as such but will explain more details if I have other questions again... ginerjm, thanks for trying to get it but everything I said made sense for advanced developers and being a developer for 9 years I will figure it, I always do. i did post an example for you above so you can understand the unlimited textfield concept, you can add a submit button to process the entries and validation I started coding this using JavaScript instead as it made more sense and will share the solution here later today if anybody is interested. Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492071 Share on other sites More sharing options...
ginerjm Posted September 25, 2014 Share Posted September 25, 2014 I'm glad you feel that your 9 years of development experience makes you confident in finding your own solution. I usually feel that way with my 30+ years of the same, but only when I understand the problem. Perhaps you will develop some better abilities using English to explain yourself in the future. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492075 Share on other sites More sharing options...
CroNiX Posted September 25, 2014 Share Posted September 25, 2014 (edited) If "student name" is a text field (I assume you mean textarea), then how do you plan on determining the number of students entered into it by the user? It depends on what the user enters...like one name per line (hitting enter after each name), names separated by spaces, names separated by commas. How do you plan on determining how the user entered the student names into that field if it's entirely up to the user? Edited September 25, 2014 by CroNiX Quote Link to comment https://forums.phpfreaks.com/topic/291268-php-fields-logic-math-input-select-fields/#findComment-1492080 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.