/    Sign up×
Community /Pin to ProfileBookmark

I have drodown which has 10,20,30,40,50 value

suppose if I select 10 then it should update all days 10 in my form table.

Please let me know if you need more description.

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERJun 17.2015 — How about some code attempt so we can see what you are talking about.

Needs a lot more description.
Copy linkTweet thisAlerts:
@hardikspider123authorJun 17.2015 — How about some code attempt so we can see what you are talking about.

Needs a lot more description.[/QUOTE]



This is my drop down outside form table and there is coloumn days in my table which has dropdown to and so what I want is if I select number 30 days from outside dropdown then it should make all days in table 30. so I can update all user with day 30

<!--Add 30 Days-->

<input id='button3' type='button' class='move' value='Add Days' />

<select id="daycombo1" class="mycombo1">

<option>SELECT</option>

<option value="1">1</option>

<option value="3">3</option>

<option value="7">7</option>

<option value="14">14</option>

<option value="30">30</option>

<option value="40">40</option>

<option value="50">50</option>

<option value="60">60</option>

<option value="70">70</option>

<option value="80">80</option>

<option value="90">90</option>

</select>


below is code for checkbox table

<script type="text/javascript">





$('#button1').click(function() {
iterate();
});


$(".mycombo").change(function() {
($(this).find("option:selected").text());
});

function iterate() {
var values = [];

$("input:checkbox").each(function() {
var $this = $(this);
// console.log($this);
var selected = {};
var $v = "";
var counter = 0;
if ($this.is(":checked")) {
$v = $this.closest("td").siblings("td")

if ($v.find("select").attr("class") == "mycombo") {
selected["memberid"] = $this.val();
selected['combo'] = $v.find("#combo :selected").text();
selected['daysadded'] = $v.find("#daycombo1 :selected").text();
}
else {

}
values.push(selected);

} else {

}
counter++;
});

var dataArrayFields = {};
// dataArrayFields['command'] = 'forgotemail';
dataArrayFields['params'] = values;
var ob = (JSON.stringify(values));

$.ajax({
type: "POST",
url: "update.php",
data: {pData: ob},

// success: function(data2) {

// whatToDo(data2);

//


// },

success: function() {

alert("Records Updated Suceessfully");

location.reload(true);

// $("#load").html(msg);

},
cache: false
});



}


function whatToDo(status) {
if (status == "success") {


// echo "Record updated succesuufully";

location.reload(true);

//

// window.location = self;

} else {

}

}


$(document).ready(function() {
$('.check:button').toggle(function() {
$('input:checkbox').attr('checked', 'checked');
$(this).val('Uncheck All')
}, function() {
$('input:checkbox').removeAttr('checked');
$(this).val('Check All');
})
})




</script>
×

Success!

Help @hardikspider123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...