assign values to a table from javascript in VF page
JavaScript
<apex:page standardController="Application__c" extensions="applicationformcontrol" id="pg1" sidebar="false">
<apex:form id="frm1">
<!—- To enable or disable the checkbox -->
<apex:inputField id="check" value="{!app.Checksamepresent__c}" onchange=" return check();"/>
</apex:form>
<!-- Javasript functionality-->
<script>
<!-- To display or hide the output panel based on the country selection for dependent country picklist or textbox -->
function check()
{
var con=document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.precon}").value;
var conp=document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.percon}").value;
if(document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.check}").checked==true)
{
if(con=="United States")
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p3}").style.display = 'none';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p4}").style.display = 'block';
else
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p3}").style.display = 'none';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p4}").style.display = 'block';
}
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.peradd1}").value=document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.preadd1}").value;
<!-- Same as Present Address, Permanent Address fields are read only -->
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.peradd1}").readOnly=true;
}
else
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p3}").style.display = 'none';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p4}").style.display = 'block';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.peradd1}").value='';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.peradd1}").readOnly=false;
}
}
<!-- To display or hide, dependent picklist or text box field based on country selection -->
function change()
{
var country=document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.precon}").value;
if(country=='United States')
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.p1}").style.display = 'block';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.p2}").style.display = 'none';
}
else
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.p1}").style.display = 'none';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs1.p2}").style.display = 'block';
}
}
function change1()
{
var country=document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.percon}").value;
if(country=='United States')
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p3}").style.display = 'block';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p4}").style.display = 'none';
}
else
{
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p3}").style.display = 'none';
document.getElementById("{!$Component.pg1.frm1.pbk.pbs2.p4}").style.display = 'block';
}
}
</script>
</apex:page>
Also in JavaScript:
- Title
- javascript check if string contains substring
- Category
- JavaScript
- Title
- flatten nested object js
- Category
- JavaScript
- Title
- heroku failed to run files from static folder in node
- Category
- JavaScript
- Title
- compare string camelcase and lowercase javascript
- Category
- JavaScript
- Title
- dumpdata json model dajngo
- Category
- JavaScript
- Title
- javascript add class to element
- Category
- JavaScript
- Title
- how to add set between two date in datatable
- Category
- JavaScript
- Title
- error sending empty object express
- Category
- JavaScript
- Title
- how to loop through array of numbers in javascript
- Category
- JavaScript
- Title
- how to empty form after submit react
- Category
- JavaScript
- Title
- how to get the last element of an array in javascript
- Category
- JavaScript
- Title
- Angularjs datetime
- Category
- JavaScript
- Title
- convert string with dot or comma as decimal separator to number in javascript
- Category
- JavaScript
- Title
- check array values equal js
- Category
- JavaScript
- Title
- bind jquery trough name
- Category
- JavaScript
- Title
- iso to date javascript
- Category
- JavaScript
- Title
- how to setstate in parent in child component in react native
- Category
- JavaScript
- Title
- express js sample project
- Category
- JavaScript
- Title
- go to another page javascript
- Category
- JavaScript
- Title
- how to validate date in react
- Category
- JavaScript
- Title
- find the last occurrence of a character in a string javascript
- Category
- JavaScript
- Title
- disable input angular
- Category
- JavaScript
- Title
- filter out arrays js
- Category
- JavaScript
- Title
- check if javascript function is true
- Category
- JavaScript
- Title
- inser js
- Category
- JavaScript
- Title
- how to make dynamic columns in jquery
- Category
- JavaScript
- Title
- how to get textedit on mac without download
- Category
- JavaScript
- Title
- background-image url not working
- Category
- JavaScript
- Title
- how to generate random string in javascript
- Category
- JavaScript
- Title
- javascript .split().reverse.join
- Category
- JavaScript
- Title
- how to append select option in jquery
- Category
- JavaScript
- Title
- how to get variable in local storage in javascript
- Category
- JavaScript
- Title
- angular http client
- Category
- JavaScript
- Title
- axios file upload
- Category
- JavaScript
- Title
- how to return an object in javascript
- Category
- JavaScript
- Title
- bind and unbind jquery validation
- Category
- JavaScript
- Title
- how to build a string javascript es6
- Category
- JavaScript
- Title
- express render
- Category
- JavaScript
- Title
- how to print an array javascript
- Category
- JavaScript
- Title
- dropzone add download button addedfile
- Category
- JavaScript
- Title
- display none after hover
- Category
- JavaScript
- Title
- import json file javascript
- Category
- JavaScript
- Title
- check if string contains substring javascript
- Category
- JavaScript
- Title
- how to count click events javascript
- Category
- JavaScript
- Title
- how to access a database in express
- Category
- JavaScript
- Title
- javascript 1 + "1"
- Category
- JavaScript
- Title
- angular countdown timer
- Category
- JavaScript
- Title
- how to display image in html from json object
- Category
- JavaScript
- Title
- for loop javascript
- Category
- JavaScript
- Title
- How to pass a map from controller to javascript function in VF page
- Category
- JavaScript
- Title
- closure javascript
- Category
- JavaScript
- Title
- how to change h1 text using javascript from node
- Category
- JavaScript
- Title
- how the map function works javascript
- Category
- JavaScript
- Title
- div non selectabel text
- Category
- JavaScript
- Title
- how to deploy react app in tomcat server
- Category
- JavaScript
- Title
- create react app theme_color
- Category
- JavaScript
- Title
- generate new component angular
- Category
- JavaScript
- Title
- how to validate an email address in javascript
- Category
- JavaScript
- Title
- audio get current time
- Category
- JavaScript
- Title
- date picker javascript not working
- Category
- JavaScript
- Title
- How to uninstall npm modules in node js?
- Category
- JavaScript
- Title
- enzyme test method
- Category
- JavaScript
- Title
- how to make @click in router-link vuejs
- Category
- JavaScript
- Title
- file input disable open file picker javascript
- Category
- JavaScript
- Title
- express validator always return error
- Category
- JavaScript
- Title
- get timer start adding the started at time js
- Category
- JavaScript
- Title
- Factorial
- Category
- JavaScript
- Title
- add class javascript
- Category
- JavaScript
- Title
- how to make javascript function consise
- Category
- JavaScript
- Title
- document delete element
- Category
- JavaScript
- Title
- change select value jquery
- Category
- JavaScript
- Title
- foreach db mongodb
- Category
- JavaScript
- Title
- how to create a new react native project
- Category
- JavaScript
- Title
- javascript change color
- Category
- JavaScript
- Title
- How do you call a functional component in React
- Category
- JavaScript
- Title
- div background image chnage uisng js
- Category
- JavaScript
- Title
- bookshelf insert multiple rows
- Category
- JavaScript
- Title
- angular form validation
- Category
- JavaScript
- Title
- get the index of object in array
- Category
- JavaScript
- Title
- javascrip reverse text
- Category
- JavaScript
- Title
- ajax request qml
- Category
- JavaScript
- Title
- array javascript django
- Category
- JavaScript
- Title
- draw rectangle on javascript canvas
- Category
- JavaScript
- Title
- empty a select input using js
- Category
- JavaScript
- Title
- add char in specific index stirng javascript
- Category
- JavaScript
- Title
- add image in react native
- Category
- JavaScript
- Title
- check if checkbox is checked javascript
- Category
- JavaScript
- Title
- funcao com o botao esc do teclado javascript
- Category
- JavaScript
- Title
- javascript check for duplicates in array
- Category
- JavaScript
- Title
- display none js
- Category
- JavaScript
- Title
- check if class is active jquery
- Category
- JavaScript
- Title
- for function js
- Category
- JavaScript
- Title
- codemirror get object from textarea
- Category
- JavaScript
- Title
- how to get data in json format in javascript
- Category
- JavaScript
- Title
- How to insert an item into an array at a specific index JavaScript
- Category
- JavaScript
- Title
- Adding and Deleting html Elements
- Category
- JavaScript
- Title
- convert 24 hour to 12 hour moment js
- Category
- JavaScript
- Title
- closure in javascript
- Category
- JavaScript
- Title
- How to abreviate digits in js
- Category
- JavaScript
- Title
- convert object to array javascript
- Category
- JavaScript