You might also want to take a look at your mark-up.
Using tables for layout purposes is not normally a good idea.
Your code snippet is also missing the <table></table> tags.
Hi pullo thank you it’s working,it must be class…you are right i can see now all values.
Using tables for layout purposes is not normally a good idea.
What should i used instead of table?
Your code snippet is also missing the <table></table> tags.
Sorry my bad, I forgot the table tag.
By the way pullo is that okay that i also used serialize for my form,and then i also used the serializeArray to get all the values of my asset1 ?
please correct me if i am wrong
the way pullo is that okay that i also used serialize for my form,and then i also used the serializeArray to get all the values of my asset1 ?
Well serialize is used to encode a set of form elements as a string for submission and serializeArray is used to encode a set of form elements as an array of names and values.
So no, it’s probably not ideal to be using both.
What exactly are you trying to do?
Can you give me a short example (but please don’t dump 2000 lines of unformatted code on me :)).
Okay the scenario here is that i have a form it has 8 textfields but i put only 4 for an example…it has also have table as you can see in my example,…and then inside my form i have a button that will trigger to create dynamically row for my table,and this row have 3 textfields actually it is 5 textfield i just put only 3 as for example.if the user will continue pressing the add button it will create another row having 3 textfield etc…so after the user filled all the textfields in my form…the user will click submit button with an id of Onsub,then it will send to my php via jquery.ajax…the reason is that i used serializeArray because in my php i could not get all the post values in my asset…but the other using serialize i have no problem getting the post values like the a,b,c,d textfield.
Hi pullo,…how do i checked this if one of the textbox is empty during submitting the form via jquery.ajax.,…I want to check the textbox asset1 if it is empty…how to do this in javascript.
Actually, I’m being stupid.
If you have more than one element of that class, then what I posted cannot work.
Try this instead:
$("#myForm").on("submit", function(){
$(".asset1").each(function(){
// Do stuff with each element of the class asset.
// e.g. console.log($(this).val())
})
});