I have the following code that runs etape.html
launch page, which allows to insert the html elements in a html block with n
iteration.
For the first iteration all is well and appears, but in the second iteration nothing appears in the div block.
The secondary consideration is executed on pressing "Suivant" button, which allows to reload the page etape.html
Someone has any idea?
index=0;
$("#etape").live('pageshow', function() {
if(index>5)
{
//Go to other Page
}
switch(id_type_champ)
{
case 1:
$('#header-right-container').append(''+nom_champ+'<input type="text" id='+Id+' > ').trigger("create");
alert("case 1");
break;
case 2:
$('#header-right-container').append(''+nom_champ+'<input type="text" id='+Id+' > ').trigger("create");
alert("case 2");
break;
case 3:
$('#header-right-container').append(''+nom_champ+'<input type="date" id='+Id+' OnClick="aff_date(\'' + Id + '\')">').trigger("create");
alert("case 3");
break;
case 4:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0></option></select>').trigger("create");
alert("case 4");
break;
case 5:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 5");
break;
case 6:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 6");
break;
case 7:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 7");
break;
case 8:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 8");
break;
case 9:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 1");
break;
default:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 1");
break;
}
$('#header-left-container').append('<a href="etape.html" data-role="button" OnClick="DoAction()" data-icon="arrow-r" data-iconpos="right" data-theme="a" id="suivant">Suivant</a> ').trigger("create");
}
function DoAction()
{
//$('#'+id+'').val() ; //GET text
//$('#'+id+'').val('AAAAAA'); //SET
index++;
alert('Button has been clicked avec un index = a '+ index);
}