how to put value in the text field usign jquery?

How to put value in the text field.

File name : index.php

function ittutorial(val){
var ISID = document.getElementById("isid").options[document.getElementById("isid").selectedIndex].text;

var oldISID = ISID.split(':')[0];
var newdocNumber = oldISID;
if($("#docType").val()!= ''){
newdocNumber = $("#docType").val() + ' ' + $("#docNum").val();
}
if($("#part").val()!= ''){
newdocNumber = newdocNumber + ' : Part ' + $("#part").val();
}
if($("#section").val()!= ''){
newdocNumber = newdocNumber + ' : Sec ' + $("#section").val();
}
if($("#subsection").val()!= ''){
newdocNumber = newdocNumber + ' : SubSec ' + $("#subsection").val();
}
$("#newdocNumber").val(newdocNumber);
}

Example :-

File name : index.php

function itechxpert(docNum)
{

var docType = document.getElementById("docType").options[document.getElementById("docType").selectedIndex].text;
var docNum = docNum;
var part = 'Part' + ' ' + document.getElementById("part").value;

/*var Part = 'Part';*/
/*var part1 = Part.concat(' ',part);*/
var Section = ' ' + ':'+ ' '+ 'Sec' + ' ' + document.getElementById("section").value;
var SubSection = ' ' + ':'+ ' '+ 'SubSec' + ' ' + document.getElementById("subsection").value;
var year = document.getElementById("yearStd").value;
var docValue = docType.concat(' ',docNum,' ');
var docValue1 = docValue.concat(':',' ',part);
var docValue2 = docValue1.concat(Section);
var docValue3 = docValue2.concat(SubSection);



if(document.getElementById("part").value =='' && document.getElementById("section").value =='')
{
document.getElementById("docNumber").value= docValue;
document.getElementById("docYear").value= year;

}
else if(document.getElementById("part").value !='' && document.getElementById("section").value =='')
{
document.getElementById("docNumber").value= docValue1;
document.getElementById("docYear").value= year;
}
else if(document.getElementById("part").value !='' && document.getElementById("section").value !='' && document.getElementById("subsection").value =='')
{
document.getElementById("docNumber").value= docValue2;
document.getElementById("docYear").value= year;
}

else if(document.getElementById("part").value !='' && document.getElementById("section").value !='' && document.getElementById("subsection").value !='')
{
document.getElementById("docNumber").value= docValue3;
document.getElementById("docYear").value= year;
}
}





Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here