$(document).ready(function(){
var skillctr = 1;
var experiencectr = 1;
var educationctr = 1;
var achievementctr = 1;
var historyctr = 1;
/*
Add Skills
*/
$("#addSkill").click(function () {
if(skillctr>10){
alert("WOW! But 10 skills are enough.");
return false;
}
var newTextBoxDiv = $(document.createElement('div'))
.attr("id", 'SkillDiv' + skillctr);
newTextBoxDiv.html('<label>Skill No. '+ skillctr + ' : </label>' +
'<input type="text" name="skill' + skillctr +
'" id="skill' + skillctr + '" value="" >');
newTextBoxDiv.appendTo("#SkillsBoxesGroup");
skillctr++;
});
so how can i save the generated fields in my table in database now?
how am i gonna declare the field in php like.. $_POST[‘skill’].
i need help here. please
Don’t use
name="skill' + skillctr + '", usename="skill[]".That way PHP will helpfully create an array that you can loop though: