I am unable to convert jquery code into javascript code. I need iteration in javascript. Can please suggest me, how to solve this problem. And also add the html code. Can you check it once.Thank you in advance.
i have small dought in above code. I tried above code in my local. I want disply the one value. it's working fine. I want display the one more value, in that case actually it displays the two values but it displayed three values. Can please suggest me how to solve the issue.Thanks you. For example :- 2 [ first enter the value] => it displayed 2 :- 7 [ enter one more vallue] => actually is displyed 2,7 but it displyed the value is 2,3,7
This is the html code :-
<?php
$form_fields = array(
'acad_year' => array('label' => '', 'label_html' => '', 'after_html' => '', 'required' => FALSE, 'class' => '', 'id' =>'year_select', 'view' => 'input/pulldown','value' => ssp_get_regform_value($user, $type, $formreturn, 'acad_year')),
'acad_campus' => array('label' => '', 'label_html' => '', 'after_html' => '', 'required' => FALSE, 'class' => '', 'id' =>'campus_select', 'view' => 'input/pulldown','value' => ''),
'acad_course' => array('label' => '', 'label_html' => '', 'after_html' => '', 'required' => FALSE, 'class' => '', 'id' =>'course_select', 'view' => 'input/pulldown','value' => ''),
'acad_specialization' => array('label' => '', 'label_html' => '', 'after_html' => '', 'required' => FALSE, 'class' => '', 'id' =>'specialization_select', 'view' => 'input/pulldown','value' => ''),
'submit' => array('label' => '', 'label_html' => '', 'after_html' => '', 'required' => FALSE, 'class' => '', 'id' =>'profile_edit_submit_stg_1', 'view' => 'input/submit','value' => 'Add a course'),
);
echo "<br>Please select one of the courses below<span class='cnfrm_warning'>*</span><br>";
//var_export($form_fields);
ssp_render_regform_array($form_fields);
?>
<div id="acad_debug_pane"></div>
<div id="acad_result_pane"></div>
<div id="result_form_div">
<p><b>Currently selected courses</b></p>
<form method="post" id="result_holder_ssp" onSubmit="return acad_result_checkform();" name="acad_final_submit">
<input type ="hidden" id="last_course_count" value = "">
<input type ="submit" name="acad_conditional_submit_" class="regform-submit" id="acad_conditional_submit_id" value="Submit Changes">
</div>
var course_map = new Array(0);
$("form#result_holder_ssp :input").each(function(){
var input = $(this);
if(input.hasClass('ssp_selected_course') || input.hasClass('ssp_selected_course_sugg')){
console.log(input.attr("name"));
course_map.push(input.val());
}
});