You need to sign in to do that
Don't have an account?
lavu
jquery in visualforce page
I displayed when click on radiobuttons shows textboxes in visualforce page using jquery.when i entered values in textboxes,save it the values are not stored.can anyone tell me by using jquery how to store the data and displayed in detail page.Iam new to jquery.
keep jquery aside for a while. Show all the text boxes in the vf page and test whether the data entered is being stored or not. what i mean is there is no special way to store data or display data in vf page when you are using jquery.
I write code in vf page using jquery when i entered the amount,no of children values in textboxes and saved the values are not displaying ,displays only the textboxes.
this is the jquery which i wrote
<!-- Page: -->
<apex:page >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Radio Button Demo</title>
<script language="javascript" type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<style>
</style>
</head>
<body>
<form action="" method="post" name="form1">
<p>
<b>Do u have life insurance today</b> <label>
<input type="radio" name="group_name" value="Yes" id="group_name_0" />
Yes</label>
<label>
<input type="radio" name="group_name" value="No" id="group_name_1" />
No</label>
</p>
</form>
<div id="yes_box">
<b>Do u have life insurance through work</b> <label><input type="radio" name="groupA" value="Yes" id="group_0_0" />Yes</label>
<label><input type="radio" name="groupA" value="No" id="group_0_1" />No</label>
</div>
<br></br>
<div id="yes_box1">
<b>How much are you covered through work</b><br></br><br></br><label>Amount <input type="text" name="groupc" value="" id="group_0_4"/></label><br></br>
<b>Does that life insurance go with you</b> <label><input type="radio" name="groupc" value="Yes" id="group_0_5" />Yes</label>
<label><input type="radio" name="groupc" value="No" id="group_0_6" />No</label>
</div>
<br></br>
<div id="yes_box2">
<b>Do you have an existing life insurance policy that you are looking to add coverage or replace</b> <label><input type="radio" name="groupd" value="Yes" id="group_0_7" />Add Coverage</label>
<label><input type="radio" name="groupd" value="No" id="group_0_8" />Replace</label>
</div>
<br></br>
<div id="yes_box3">
<b>How much coverage</b> <br></br><br></br> <label>Amount <input type="text" name="groupe" value="" id="group_0_9" /></label>
</div>
<div id="no_box1">
Refer to an EFS <label></label>
</div>
<div id="no_box">
question 3 -> <label><input type="radio" name="groupB" value="Yes" id="group_0_2" />Ok</label>
<label><input type="radio" name="groupB" value="No" id="group_0_3" />Not Ok</label>
</div>
<div id="question4">
question 4 wow -> not cool
</div>
<div id="question5">
Question 5 -> perfect -> Not perfect
</div>
<label><input type="checkbox" name="group_name1" value="checked" id="group_name_a"/>Mortgage or Rent</label><br></br><br></br>
<div id="yes_box4">
<b>Do u own your home or rent </b> <label><input type="radio" name="groupf" value="Yes" id="group_0_10" />Own Home</label>
<label><input type="radio" name="groupf" value="No" id="group_0_11" />Rent</label> <br></br>
</div>
<div id="yes_box5">
<b>What is the approximate value that you still owe on your mortgage and how many years remaining </b> <label><input type="text" name="grouph" value="" id="group_0_12" />Mortgage amount</label>
<label><input type="text" name="grouph" value="" id="group_0_13" />Years Remaining</label>
</div>
<div id="no_box3">
<b>What is the approximate value that you pay monthly for rent</b><label><input type="text" name="groupk" value="" id="group_0_14" />Rent Amount</label>
</div>
<label><input type="checkbox" name="group_name2" value="checked" id="group_name_b"/>Married</label><br></br><br></br>
<div id="yes_box6">
<b>Do u know if spouse has life insurance coverage </b> <label><input type="radio" name="groupi" value="Yes" id="group_0_15" />yes</label>
<label><input type="radio" name="groupi" value="No" id="group_0_16" />No</label> <br></br><br></br>
</div>
<div id="yes_box7">
<b>Do u know how much coverage your spouse has</b> <label><input type="text" name="groupj" value="" id="group_0_17" />coverage amount</label>
</div>
<div id="no_box4">
<b>lets take care </b><br></br>
</div>
<label><input type="checkbox" name="group_name3" value="checked" id="group_name_c"/>Children</label><br></br><br></br>
<div id="yes_box8">
<b>How many children do you have</b><br></br><br></br> Number of children <label><input type="text" name="groupl" value="" id="group_0_18" /></label><br></br><br></br>
<b>What are their names and how old are they</b><br></br><br></br> First Name <label><input type="text" name="groupl" value="" id="group_0_19" /></label><br></br><br></br>
Age <label><input type="text" name="groupl" value="" id="group_0_20" /></label><br></br>
</div><br></br>
<label><input type="checkbox" name="group_name4" value="checked" id="group_name_d"/><b>Are you looking to obtain life insurance on your children incase something were to happen to them</b></label><br></br><br></br>
<div id="yes_box9">
Let's take care of getting a quote and then we can talk about adding coverage to your policy for your children.<label></label><br></br>
</div>
<label><input type="checkbox" name="group_name5" value="checked" id="group_name_e"/>Final Expenses</label><br></br><br></br>
<div id="yes_box10">
<b>For our customers we typically through include a final expenses plan of $15,000 to cover their burial expense</b><label></label><br></br><br></br>
</div>
<label><input type="checkbox" name="group_name6" value="checked" id="group_name_f"/>Other Needs</label><br></br><br></br>
<div id="yes_box11"><br></br>
Other Needs <label><input type="text" name="groupm" value="" id="group_0_21" /></label><br></br><br></br>
<b>1.Helpful Hint 1:<br></br>If possible explore what the customers true need is and enter it in category above.Ex: if customer says protection, ask them what they are looking to protect<br></br><br></br> 2.Heplful hint 2:<br></br>If customer situation is complex situation refer to producer. Ie(owner is organization,group insurance)</b><label></label>
</div>
<script>
$(document).ready(function(){
$("#txtEmail").val("something")
$("input[name$='group_name']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#yes_box").show("slow");
$("#no_box").hide("fast");
} else if(radio_value=='No')
{
$("#no_box").show("slow");
$("#yes_box").hide("fast");
}
});
$("input[name$='groupB']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#question4").show("slow");
$("#question5").hide("fast");
} else {
$("#question4").hide("fast");
$("#question5").show("slow");
}
});
$("input[name$='groupA']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#yes_box1").show("slow");
$("#no_box").hide("fast");
}
else if(radio_value=='No') {
$("#no_box").show("slow");
$("#yes_box1").hide("fast");
}
});
$("input[name$='groupc']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#yes_box2").show("slow");
$("#no_box2").hide("fast");
} else {
$("#no_box2").hide("fast");
$("#yes_box2").show("slow");
}
});
$("input[name$='groupd']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#yes_box3").show("slow");
$("#no_box1").hide("fast");
} else if(radio_value=='No')
{
$("#no_box1").show("slow");
$("#yes_box3").hide("fast");
}
});
$("input[name$='group_name1']").click(function(){
var checkbox_value = $(this).val();
if(checkbox_value=='checked') {
$("#yes_box4").show("slow");
} else
{
$("#yes_box4").hide("fast");
}
});
$("input[name$='group_namef']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#yes_box5").show("slow");
$("#no_box3").hide("fast");
} else if(radio_value=='No')
{
$("#no_box3").show("slow");
$("#yes_box5").hide("fast");
}
});
$("input[name$='group_name2']").click(function(){
var checkbox_value = $(this).val();
if(checkbox_value=='checked') {
$("#yes_box6").show("slow");
} else
{
$("#yes_box6").hide("fast");
}
});
$("input[name$='group_namei']").click(function(){
var radio_value = $(this).val();
if(radio_value=='Yes') {
$("#yes_box7").show("slow");
$("#no_box4").hide("fast");
} else if(radio_value=='No')
{
$("#no_box4").show("slow");
$("#yes_box7").hide("fast");
}
});
$("input[name$='group_name3']").click(function(){
var checkbox_value = $(this).val();
if(checkbox_value=='checked') {
$("#yes_box8").show("slow");
} else
{
$("#yes_box8").hide("fast");
}
});
$("input[name$='group_name4']").click(function(){
var checkbox_value = $(this).val();
if(checkbox_value=='checked') {
$("#yes_box9").show("slow");
} else
{
$("#yes_box9").hide("fast");
}
});
$("input[name$='group_name5']").click(function(){
var checkbox_value = $(this).val();
if(checkbox_value=='checked') {
$("#yes_box10").show("slow");
} else
{
$("#yes_box10").hide("fast");
}
});
$("input[name$='group_name6']").click(function(){
var checkbox_value = $(this).val();
if(checkbox_value=='checked') {
$("#yes_box11").show("slow");
} else
{
$("#yes_box11").hide("fast");
}
});
$("#yes_box").hide();
$("#no_box").hide();
$("#question4").hide();
$("#question5").hide();
$("#yes_box1").hide();
$("#yes_box2").hide();
$("#yes_box3").hide();
$("#no_box1").hide();
$("#yes_box4").hide();
$("#yes_box5").hide();
$("#no_box3").hide();
$("#yes_box6").hide();
$("#yes_box7").hide();
$("#no_box4").hide();
$("#yes_box8").hide();
$("#yes_box9").hide();
$("#yes_box10").hide();
$("#yes_box11").hide();
});
</script>
</body>
</html>
</apex:page>
the output is like this.i entered the amount,FN,LN,no of children and saved in vf page but in detail page its not displaying the values
Do u have life insurance today Yes No
Amount Does that life insurance go with youYesNo
coverage Amount
Mortgage or Rent
Married
Children
Number of children
What are their names and how old are they
First Name
Age
Are you looking to obtain life insurance on your children incase something were to happen to them
Final Expenses
Other Needs