Help with a database insert |
[eluser]Miguel Diaz[/eluser]
Great now is storing the information there is only one more problem it is sending 0 instead of the value
[eluser]Miguel Diaz[/eluser]
Yes I have the seven values insert in the database but all with zero
[eluser]adityamenon[/eluser]
What happens when you echo out $this->input->post('telefonia');? We are probably annoying everybody, this kind of thing should be done on IRC
[eluser]Miguel Diaz[/eluser]
jejej that is true I tried this to check Code: $categorias = array( http://localhost:8888/clientes_corporati...&localID=1
[eluser]adityamenon[/eluser]
Why does the URL have any values? That is GET method... then your code should be $this->input->get('telefonia'); everywhere.
[eluser]Miguel Diaz[/eluser]
That was totally right you make me see my stupidity I erase the method in my form when I was checking what was happening. now works great One more question I am passing the input hidden to my form with ajax in this case when the people click in the category an input hidden is added to the view through ajax I did this because I do have a lot more subcategories and subsubcategories. imagine this was just for the categories and I only have 7 categories but in one subcategory I do have 180subcategories that are related to the first category. But I would like to have a way that if the input is not in the form do not send nothing What you think is that possible. Thanks for all your help it is really great to find people like you
[eluser]adityamenon[/eluser]
Whenever a new hidden input class is generated, make sure you add a class to it. Before the form data is submitted, count the number of elements with that class name. If the number is 0, then the user did not select any categories. Return false in javascript to the click of the form submit button and display an alert asking them to select atleast one field. I don't have the time to write the JS code right now... but it's very easy to do with jQuery. |
Welcome Guest, Not a member yet? Register Sign In |