[PART 2]ADD DYNAMIC FIELDS TO FORMS WITH JQUERY AND PHP

Поделиться
HTML-код
  • Опубликовано: 9 сен 2024

Комментарии • 72

  • @henriquehims
    @henriquehims 3 года назад

    Thank you very much. You are a great teacher. great teaching. A Brazilian subscribed to your channel

  • @okezie7211
    @okezie7211 7 лет назад

    You have given me a rare opportunity to learn without much stress. So oo simple and on point explanation. Thank you for this....

    • @phpBasics
      @phpBasics  7 лет назад

      Thank you very much. If you need any assistance, let me know. My Skype is CoolEditz

  • @hamidi88habib57
    @hamidi88habib57 3 года назад

    great for learning tnq alot

  • @shekharmehta2506
    @shekharmehta2506 7 лет назад +3

    How does one add select data to a field (from mysql ) and have this duplicated when the rows are added. THis is a great tutorial... but where does one get the source code.

  • @manojchacko4203
    @manojchacko4203 4 года назад +1

    Hi great tutorial, I had one quick question, how do you set it up so that on post back make sure the values are retained because if not someone hit submit but missing something and on postback if this field refreshes dont want to have to type it all again.
    Similarly if I am editing this for how do I retrieve these values from the database and display such the functionalit stays the same

    • @phpBasics
      @phpBasics  4 года назад

      Something like this -

    • @manojchacko4203
      @manojchacko4203 4 года назад

      @@phpBasics yes, but how do you this for the dynamically generated fields, like the ones you have on the video, upon submission, if there is an error on the form don't want the dynamically generated fields to reset

  • @ShahzadAli-ni6ny
    @ShahzadAli-ni6ny 5 лет назад

    thumbs up bro!!! you really are a great teacher.

  • @jim9408
    @jim9408 3 года назад

    Hey Shawn, I am a big fan of your tutorials. I should start off by stating that I am new to programming. Here is what I am trying to do and I am struggling: Right about at your 10 minute mark in this video.
    Ok. I am trying to enter data from an array, with an SQL query, using PDO, using a prepared statement, using :placeholders. I can execute the prepared statement no problem. Following your tutorials, I can add additional rows to my form, remove excess rows, submit the data, then, enter the data from multiple rows into the database. However, I am having trouble figuring out how to sanitize/filter the data before it is inserted into the database.
    Usually, when I enter data from a form I use this line of code because the information is not from an array: $company = filter_input(INPUT_POST, 'company', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
    Do you know of a way to sanitize/filter the data using a prepared statement with placeholders? Or, should I abandon the prepared statement/:placeholder method in favor of the method you describe in this tutorial?
    I hope this makes sense. Thanks in advance. Jim
    Update: I found a way to make this work. Right after you check if the form has been submitted (Line 5 ), enter the "filter_input_array" function like this:
    $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);

  • @JoseHernandez-ln7sr
    @JoseHernandez-ln7sr 4 года назад

    Good evening, I have a small inconvenience, because I have the code to generate dynamic fields, but then when saving the data in the database it does not save all of them, that is, I create 3 columns of 4 rows each and only save the last four rows.

  • @stevewillis544
    @stevewillis544 3 года назад

    Hey you should update more! You have a great teaching style

    • @phpBasics
      @phpBasics  3 года назад +1

      I appreciate the feedback. I have new content coming soon :)

  • @karthikrish5341
    @karthikrish5341 3 года назад

    Hi sir this video is more using for me i have an doubt how i insert primary key and foreign key in that table like to reference another table

  • @WaDalai1
    @WaDalai1 2 года назад

    you just saved my life, thanks

  • @naveedansari3462
    @naveedansari3462 3 года назад

    How Can I add Dropdown lint in dynamic fields? Please must reply.

  • @R0b3
    @R0b3 3 года назад

    Good job dude!!! Is it possible use same logic in order to insert multiple record into different tables with foreign key?

  • @pearlabotsi2861
    @pearlabotsi2861 4 года назад

    So awesome thank you! God bless

  • @akhilkazi1454
    @akhilkazi1454 4 года назад

    Hello sir,
    I have a data working with rows counting. I want to it counted when inserting and deleted record seperately.

  • @theresiaalfareja8840
    @theresiaalfareja8840 2 года назад

    Thanks for th tutorial. But on my web page , checkbox doesn't work properly in the var html. Can you help me?

  • @janzca6829
    @janzca6829 3 года назад

    Really thanks

  • @josephlongo3991
    @josephlongo3991 7 лет назад

    Great tutorial! Ironically, I am trying to do the opposite of this. I have an HTML element that is dynamically populated from a MySQL database. The table contains the serial numbers of car seats available for rent. Sometimes, people rent multiple car seats and therefore, I would need to "add" as many car seats to their order form as necessary. Would I use the same process for select elements that are dynamically populated as you did?

    • @phpBasics
      @phpBasics  7 лет назад

      I would populate the first select tag and then copy it the way I did. That way you don't have to keep querying the database

    • @josephlongo3991
      @josephlongo3991 7 лет назад

      phpBasics after I've populated it from the database, I would in essence follow the video, making minor adjustments where necessary?

    • @phpBasics
      @phpBasics  7 лет назад

      Yes. You can skype me if you run into problems. CoolEditz

  • @SandeepSingh-me4hx
    @SandeepSingh-me4hx 6 лет назад

    Awesome tutorial, it helped me a lot. Also please can you help me, how can I add a select dropdown with data from database. Or do you have any video tutorial of that... Thanks a lot once again...

  • @nitheeshkumark7947
    @nitheeshkumark7947 4 года назад

    Thanks a lot for the video sir.. It greatly helped me.. Can you please assist me in the following scenario?? So, along with the fields that you have taken, I have included order Id also in the form... and to that order Id.. I have given the auto numbering code... So.. for the parent field.. the automatic number system is working as expected. However, for the child field.. i.e., for the fields with the Add more link are not getting automatic numbers.. How can we resolve this.. please explain..

  • @AAplayer13GOA
    @AAplayer13GOA 7 лет назад

    Have you thought about doing a web series on creating a modern website from scratch? It would be interesting to see the process from your point of view and to see what route you take. Good video btw.

    • @phpBasics
      @phpBasics  7 лет назад

      Is there a particular style of website you're interested in seeing? I could definitely put something like that together, but I'm not much of a front end designer.

    • @AAplayer13GOA
      @AAplayer13GOA 7 лет назад

      A good example could be a website where users can review products. Each user would have their own accounts and ability to interact with each other maybe. There could also be a search functionality within the website.

  • @zibbp97
    @zibbp97 6 лет назад

    Is there a way to insert all fields under 1 ID in the database?

  • @sultan2058
    @sultan2058 2 года назад

    Sir, I have two tables. (Users) (Posts) and I linked it to something called (Foreign Key) but I want to display one user's posts among other users' posts. I'm always looking for this thread, but I can't find who explains it and fetches single user posts, if you know this please explain it in a video in php - pdo

    • @phpBasics
      @phpBasics  2 года назад

      You can Skype me if you'd like: COOLEDITZ

    • @sultan2058
      @sultan2058 2 года назад

      @@phpBasics I don't have an account but I will create

  • @kambhampatis
    @kambhampatis 7 лет назад

    Excellent video. can you post code using PDO for inserting multiple rows of data into sql table? the php version you have used is older and I am unable to make it work.

  • @shebinsilvister2632
    @shebinsilvister2632 5 лет назад

    Great man ..Thanks!!

  • @carminevacirca3891
    @carminevacirca3891 5 лет назад

    Great instructional video. Although I populate more than one row of data within the form. When I retrieve it to update my database only the first row of the array contains data. What am I doing wrong.

  • @theadedheart2307
    @theadedheart2307 4 года назад

    mine only adds the first row to db..can anyone please tell me why its happening? followed the tutorial step by step

    • @phpBasics
      @phpBasics  4 года назад

      Hi, Jane. If you'd like to send me your source code, my Skype is CoolEditz

  • @rishavnishant
    @rishavnishant 7 лет назад

    If I am trying to send the contents of these dynamic variables in an email using php. How do I address these variables in my external php file?
    $make=$_POST['make']; ---- What would be the variable for the next make?

    • @phpBasics
      @phpBasics  7 лет назад

      Check out the foreach function in PHP.

    • @rishavnishant
      @rishavnishant 7 лет назад

      Thank You for taking out time to respond, I would try that now!

  • @shilpam7845
    @shilpam7845 5 лет назад

    how to make one of the fields have a drop down box with options as values from a mysql database

    • @phpBasics
      @phpBasics  5 лет назад

      I have a video on that.

    • @shilpam7845
      @shilpam7845 5 лет назад

      i found it, but that shows a static drop down box . I wanted to make one of the fields shown in the above video itself as a drop down box.

  • @rajuahmed695
    @rajuahmed695 6 лет назад

    how do you remove them from the data base, cause you added to it, how do u remove it

  • @stevefernando3295
    @stevefernando3295 4 года назад

    Hi can you help how to create a form from the excel upload with the db data!

    • @phpBasics
      @phpBasics  4 года назад +1

      I believe so. Feel free to reach out on Skype: CoolEditz

  • @VeljkoBijelivuk
    @VeljkoBijelivuk 6 лет назад

    if i add 1 row, it works and make, model and serial values are written in db, but if i add multiple rows it does not work. i'm not getting an error but mutliple values are not written into db. anybody has any clue? (code is exact copy of code from video)

    • @VeljkoBijelivuk
      @VeljkoBijelivuk 6 лет назад

      found it, fixed it :-)

    • @utkarshsharma4432
      @utkarshsharma4432 6 лет назад

      I am having the same problem. How did you fix It?

    • @carminevacirca3891
      @carminevacirca3891 5 лет назад

      @@VeljkoBijelivuk what was your solution? I am only able to populate the first row of the array within the form. What am I doing wrong?

  • @raceinsviet
    @raceinsviet 4 года назад

    how to same value add sql table. plz explain

  • @MandOBros
    @MandOBros 7 лет назад

    Currently getting this error, and the last field to be sent doesn't appear in the database

    • @MandOBros
      @MandOBros 7 лет назад

      Undefined offset: 1

    • @phpBasics
      @phpBasics  7 лет назад

      Undefined offset typically revolves around the array key. It means you're referencing a key that's not valid. Make sure you're starting at 0 and not 1. If you have any other issues, send me a message on Skype. CoolEditz

  • @erosmarcuszamora8828
    @erosmarcuszamora8828 5 лет назад

    please upload the same tutorial but with the radio input.

  • @anilvrathod
    @anilvrathod 5 лет назад

    How can convert these data in to json

  • @theresaway4075
    @theresaway4075 2 года назад

    How to prevent duplicate entry?

    • @phpBasics
      @phpBasics  2 года назад +1

      Do a query against the database for that serial number before the insert. If number of rows returned is NOT 0, then that item already exists.

  • @wweuniversenepal6707
    @wweuniversenepal6707 6 лет назад

    can anyone help me with the num_rows key word

  • @mahammadarafijalalanavar550
    @mahammadarafijalalanavar550 7 лет назад

    can you please describe how to retrive data in same fields

    • @phpBasics
      @phpBasics  7 лет назад

      I don't understand what you mean.

    • @mahammadarafijalalanavar550
      @mahammadarafijalalanavar550 7 лет назад

      1) i mean fetching data from data base and edit the inputs and again update the input fields
      and insert new inputs with updated inputs .
      2) can i write insert and update queries at a time ??

  • @jasuabetv2296
    @jasuabetv2296 7 лет назад

    real_escape_string not working T.T HELP!!

    • @phpBasics
      @phpBasics  7 лет назад

      If you're incorporating this into your own code, make sure you're using NEW MySQLi to connect to your database or it won't work.

  • @rojawaddepalli7455
    @rojawaddepalli7455 6 лет назад

    how to do this in java netbeans

  • @hemasingamsetty5555
    @hemasingamsetty5555 4 года назад

    hi sir
    can u show us how to upload & save an image into database using this concept

  • @noor-dev
    @noor-dev 6 лет назад

    How to use this code using codeigniter