-1

Hi i am new for PHP. I want help, I added one selection box in my form and some text box and one Save button.When page load Selection box fills with some data form MySQL table,i know this much only now i want when i select other value from selection box then in text box will fill related data from MySQL table and when i press Save button all data(which is in text box) will save in other table. please give me code for this. send to ujrnayak@gmail.com

2
Contributors
2
Replies
42
Views
6 Years
Discussion Span
Last Post by saadsaidi
0

This is a ajax(JQuery)/php matter giving you code just like this will not solve your problem.
never the less here is some a sample and taking in consideration that you already know how to deal with data retrieval via mysql
include the jquery library in the page header
include this the following code in javascript tags and remember to give ids for your html textbox and selectbox

$("#selectBox").live('change', function(e){
	var value = $("#selectBox").val();
	$.ajax({
		beforeSend: function(){
			$('#textbox').empty();
		},
		url: "where/php/script/is/script.php", 
		type: "POST",
		data: 'recordID='+$value,
		dataType: "html",
		cache: false,
		success: function (html) {
			$("#textbox").val(html);
		}
	});	
	return;
});

I hope this gives you a glimpse

0

This is a ajax(JQuery)/php matter giving you code just like this will not solve your problem.
never the less here is some a sample and taking in consideration that you already know how to deal with data retrieval via mysql
include the jquery library in the page header
include this the following code in javascript tags and remember to give ids for your html textbox and selectbox

$("#selectBox").live('change', function(e){
	var value = $("#selectBox").val();
	$.ajax({
		beforeSend: function(){
			$('#textbox').empty();
		},
		url: "where/php/script/is/script.php", 
		type: "POST",
		data: 'recordID='+$value,
		dataType: "html",
		cache: false,
		success: function (html) {
			$("#textbox").val(html);
		}
	});	
	return;
});

I hope this gives you a glimpse

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.