onchange dropdown menu into text box


hello..hi...i have a little prob here where i need to display selected item from dropdown menu into text box. i'm also combine the with php code. what i want to is when user select the item it will display on textbox call programme and also when button search is click it will display the total number of particular programme. for now both my function is not working. here is the code and interface...

//for display on textbox function addOption(x) { sOption=document.getElementById('programme').value; sOptions=sOption.split("\n"); if (sOption == '') {document.getElementById('programme').value=x+"\n";} else { if (sOptions.length > 1) {document.getElementById('programme').value=sOption+x+"\n";} else {document.getElementById('programme').value=sOption+"\n"+x+"\n";} } document.getElementById('programme').focus(); }

//for the design and php code Welcome [Logout] Programme Summary Programme Selected :

Programme : --- Select Programme --- DIP IN MULTIMEDIA TECHNOLOGY DIP IN MULTIMEDIA (BUSINESS COMPUTING) DIP IN MARKETING WITH MULTIMEDIA DIP IN MANAGEMENT WITH MULTIMEDIA DIP IN COMPUTER SCIENCE Total Student = Student Details Student Hostel Student Fee Student Payment Student Information Student Fees < include('calendar.inc'); > Programme Payment Inbox Send Copyright 2009 MMC Kuching Attached image(s)
Posted On: Monday 26th of November 2012 10:34:19 PM Total Views:  395
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




Ajax - previous value not getting changed when onchange event occurs

Assume: seat no:225 sys_no:D0009 loc:whatever chosen from the list Javascript code: function seat_no(loc, seat_no, sys_no) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (loc=="Select") { alert("Please select your Location!!!"); }else{ qstr = "seat_no=" + seat_no +"&sys_no=" + sys_no +"&loc=" + loc; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET", "seat.php"+qstr, true); xmlhttp.send(); } } PHP code (in server) Where the result is getting displayed Everything works for me, but when choosing chennai, the test fields are displayed(perfect result). After choosing chennai, if i choose anyother option in the list (for example: Delhi), the text field which dispalyed for chennai is not getting changed to empty table. Please guide me where am i making mistake
VIEWS ON THIS POST

206

Posted on:

Saturday 10th November 2012
View Replies!

jQuery onchange

, I have the following code: I am trying to make it so when you tick the box it changed the result to what you clicked, then if you untick it it changes the result back... There will be multipal tick boxes on a page... Here is my code... function Tickbox(id){ $('#cb').unbind('change'); $('#cb').change(function() { Untickbox(id); return false; }); $('#result').html(id); } function Untickbox(id){ $('#cb').unbind('change'); $('#cb').change(function() { Tickbox(id); return false; }); $('result').html('none'); }
VIEWS ON THIS POST

132

Posted on:

Saturday 10th November 2012
View Replies!

iframe onchange event?

Okay I am relatively new to javascript, and my project is to create an xhtml page that contains and javascript that monitors the changes in a web page's source code. Okay. I got everything down, except I don't know how to do an onchange event that works with javascript. summary: Can someone suggest how I can check for a change in a web page using javascript with .
VIEWS ON THIS POST

250

Posted on:

Saturday 10th November 2012
View Replies!

onchange retain POST value when submitted

$DoCNO=$_POST["DoCNO"]; $NumAt=$_POST["NumAt"]; how to retain my $_POST value when it submitted my myform it seem when submit it will reset the value inside the $DoCNO and $NumAt value java script: function testResults (form) { var TestVar = form.inputbox.value; location.href="PrintMe.phpResult=" + TestVar; return false; }my PHP code: Dee No. Project Milestone Remarks Signature/Date
VIEWS ON THIS POST

161

Posted on:

Saturday 10th November 2012
View Replies!

onchange submit problem

I am having problems with this form it has two submit options a button and an onchange instance the onchange just will not work can any one tell me why my doc type is the form is SubjectDateFrom Move To: Folder
VIEWS ON THIS POST

163

Posted on:

Saturday 10th November 2012
View Replies!

how work onchange function in javascript

Hi , I have three drop down menu naming client,project and activity. But I want that when i select item in first drop down menu clent then only that project should come whichever comes under that client category and after selecting client and project , i want there should be come only that activity which come under client and project name. How i can do this with the help of javascript ,please help me ,its very urgent for me. If you have not clarify this point or if you want more elaboration of this point then please tell me . because i am making a timesheet for a company employees. so i need this.
VIEWS ON THIS POST

177

Posted on:

Saturday 10th November 2012
View Replies!

JavaScript onchange function on drop down list

hi .... i am trying to validate the option drop down list of date which consists day, month and year.. lets say if the user choose 31 on 'day', February on 'month' and 2011 for 'year' .. it will return alert error .. i have been trying to validate and display the error if the user choose the improper date like the example above .. below is my script for the validation date... and it is quite easier to understand as well... hope someone here can help me ...
VIEWS ON THIS POST

153

Posted on:

Monday 12th November 2012
View Replies!

input checkbox onchange not working on IE7

I am finding that does not seem to work properly on IE7. http://www.aarongray.org/Test/JavaScript/checkbox.html It works fine on FF and Google Chrome. Any suggestions Many
VIEWS ON THIS POST

211

Posted on:

Thursday 15th November 2012
View Replies!

Ajax and two functions in ONE onchange, doesnt work?

Hi all! I am trying to include two functions in an onchange when the user selects a new value from a select list: It is a quite big form form - There are one select list, when changed - TWO other fields in the form needs to change accordingly: I put the information back using ajax and place it within a ; I have checked the span ids, and they are correct! Unfortunately, the second function disables the first one :-/ This is the select list with the onchange functions: In the top of the page I have included two JS files, which run each function, and opens a ajax request for each their php file which returns the wanted data (not quite yet..) The top one:ajaxJS/underside_position.js function hentPosition(str) { if (str=="") { document.getElementById("placering").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("placering").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","ajaxPHP/underside_position.phpq="+str,true); xmlhttp.send(); } The first one opens this php file, and returns the data fine when running alone: session_start(); // Find positions for second dropdown list $hoved_side_id = $_GET['q']; // Fra ajax i filen underside_position.js i ajaxJS folder $sql = "SELECT placering FROM undersider WHERE hovedside_id ='$hoved_side_id'"; $resultat = mysqli_query($connection, $sql); // If a new subject, return $count+1: if ($_SESSION['gammelt_hovedside_id'] != $hoved_side_id) { echo ''; $position_count = mysqli_num_rows($resultat); for($count=1; $count The second function:ajaxJS/url_key.js function urlKey(str) { if (str=="") { document.getElementById("url_key").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("url_key").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","ajaxPHP/url_key.phpq="+str,true); xmlhttp.send(); } Opens this php file: $url_id = $_GET['q']; // Just testing if it gets printed the right place, which it does echo $url_id; When I am using both functions, the first one becomes inactive and doesnt work, how can i change that, fix that If i enter something else than q="+str,true - lets say url_key="+str,true I get an undefined index error, also if i change this: $url_id = $_GET['url_key']; But i dont when i write q in the get, hmm Basically:How can i make this work, so I can use ajax to update two fields when an onchange has happened to the select list It works fine when i use the functions alone, but i need them both though :-) Hope someone has some experince in this, as i am not the most experienced using JS, ajax.
VIEWS ON THIS POST

231

Posted on:

Friday 16th November 2012
View Replies!

onchange javascript code not working in Internet Explorer

My JavaScript code works in all browsers except ie, I am not sure why. Any help is appreciated, Thank you. Website is http://illcomputers.comyr.com/custom.php Javascript File http://illcomputers.comyr.com/scripts/lowendcost.js JavaScript Code function updatecost1() { const keymouse = 40; const Case = 55; var data = document.getElementById("data"); var seldata = data.selectedIndex; var cpu = document.getElementById("cpule"); var selcpu = cpu.selectedIndex; var mem = document.getElementById("memorylemr"); var selmem = mem.selectedIndex; var video = document.getElementById("videole"); var selvideo = video.selectedIndex; var os = document.getElementById("osle"); var selos = os.selectedIndex; var sound = document.getElementById("soundlemr"); var selsound = sound.selectedIndex; var dvd = document.getElementById("dvdwrite"); var seldvd = dvd.selectedIndex; var floppy = document.getElementById("floppy"); var selflpy = floppy.selectedIndex; var power = document.getElementById("power"); var selpower = power.selectedIndex; var monitor = document.getElementById("monitor"); var selmon = monitor.selectedIndex; var speakers = document.getElementById("speakers"); var selspeakers = speakers.selectedIndex; if (0 == selcpu) { var cpule = 80; } else { var cpule = 160; } if (0 == selmem) { var memle = 30; } else if (1 == selmem) { var memle = 50; } else { var memle = 60; } if (2 == selvideo) { var boardle = 65 var videole = 40; } else if (1 == selvideo) { var videole = 0; var boardle = 115; } else if (0 == selvideo) { var videole = 0; var boardle = 65; } if (0 == selsound) { var soundle = 0; } else { var soundle = 70; } if (0 == selos) { var osle = 125; } else if (1 == selos) { var osle = 80; } else { var osle = 135; } if (2 == seldata) { var datacost = 70; } else if (3 == seldata) { var datacost = 95; } else { var datacost = 45; } if (0 == seldvd) { var dvdcost = 30; } else { var dvdcost = 40; } if (0 == selflpy) { var flpycost = 0; } else { var flpycost = 25; } if (0 == selpower) { var pwrcost = 28; } else if (1 == selpower) { var pwrcost = 35; } else { var pwrcost = 60; } if (0 == selmon) { var mntrcost = 0; } else if (1 == selmon) { var mntrcost = 170; speakers.disabled = true; } else if (2 == selmon) { var mntrcost = 120; } else { var mntrcost = 180; } if (0 == selspeakers) { var speakerCost = 0; } else if (1 == selspeakers) { var speakerCost = 20; } else { var speakerCost = 40; } var mainitems = datacost + dvdcost + keymouse + flpycost + pwrcost + mntrcost + speakerCost + Case; var lowitems = cpule + memle + videole + soundle + boardle + osle; var total = mainitems + lowitems; document.getElementById("amt1").value = "$" + total.toFixed(2); Intel Core 2 Duo 2.7Ghz Intel Core 2 Quad 2.6GHz ... Grand Total 
VIEWS ON THIS POST

140

Posted on:

Friday 16th November 2012
View Replies!

onchange listbox fill related course in second listbox

NAME COURSES /* how will the value of second list box come and how $ftch['user_id'] this put in where condition for selcting data from table with where conditioin pls tell me*/
VIEWS ON THIS POST

164

Posted on:

Friday 16th November 2012
View Replies!

onchange event of select box?????

, I want to make one application using javacript or may be it is in ajax. Let me explain my problem: I have one select box name person which have value 0,1,2,3,4,5 . Now i want that when user will select value 1 from select box then person 1 first name , last name input type box will appear only one time in a row. and if we will select 2 from select box then two row will appear naming person1 and person2 like this : if we will not select any value by default is 0.then it will not show any row regarding person. for exa:- if we will select 3 from select box , then three row will disappear like this person1 firstname1 lastname1 class1 section1 person2 firstname2 lastname2 class2 section2 person2 firstname3 lastname3 class3 section3 Please help me to solve this problem . How it can be.
VIEWS ON THIS POST

158

Posted on:

Friday 16th November 2012
View Replies!

Readonly fields and onchange

I've got 3 date fields on a form, each is set using the standard datetimepicker.js, however I have set the resulting text field to readonly to prevent users entering silly date formats into the field. However the 3 fields must be in the correct order i.e. datetime1 must be before datetime2 and datetime2 must be before datetime3 The datefields are defined as below
VIEWS ON THIS POST

234

Posted on:

Friday 16th November 2012
View Replies!

onchange input field focus on other input field

, does anyone know a simple way to focus on a different text field after the user enters data in the first text field
VIEWS ON THIS POST

187

Posted on:

Monday 19th November 2012
View Replies!

select onchange with typing in Webkit

In Firefox, IE and Opera, with a select menu with size > 1, typing a few characters in the menu selects an item and triggers the onchange event. In the Webkit-based Safari and Google Chrome, the item appears to be ...
VIEWS ON THIS POST

191

Posted on:

Thursday 22nd November 2012
View Replies!

How to use onchange function to check entered value?

I would like to add the on change check function on my question form. Example: In question 2 radio button selection, user select the value as "3" In question 3 text field, after user enter the value the onchange function will check if the entered value is greater than value selected in question 2, alert message will pop out. Below is the script i found similar to what i want . how can i modify this onchange function to compare 2 value in form 2 groups 3 groups 4 groups 5 groups
VIEWS ON THIS POST

174

Posted on:

Friday 23rd November 2012
View Replies!

dropdownlist onchange

I working on OnlineTraveling project, here issue is whenever I choose source city from dropdownlist at that event only related cities would be comes in dropdownlist of Destination city. It should not need to goes to server, it would be happen on same page. I have done this by page submitting using javascript to server, but that time total page refresh and fluctuated. So please help me.
VIEWS ON THIS POST

245

Posted on:

Saturday 24th November 2012
View Replies!

Got problem in the onchange function

There is one table that have fields included the add row button. I am using onchange event to call data from other tables, so when I select an option in the option box can automatically get the value that has been selected earlier (do not need input the value manually). Then I add row in the same table and after that I select one option back in the box option and get different values \tfrom the first, the problem is the values \tobtained appear in the first box, not in the second box. For the html example: No Name Class Point Action 1  
VIEWS ON THIS POST

215

Posted on:

Sunday 25th November 2012
View Replies!

get the value of a textbox on onchange()

hi , i just want to ask, how could i get the value of the textbox using the onchange() function. i know that using the form action and method get is one possible solution but what i want is that the value of the textbox in page1 should be passed to another php page page2 for some record hunting using database then pass it again to the page1 and put the result of the record hunting to another textbox..is that possible i know it is possible, but could you help me find the simplest possible way ever tnx in advance..^^
VIEWS ON THIS POST

151

Posted on:

Sunday 25th November 2012
View Replies!

calling multiple ajax function on single onchange()

Actually i made two ajax function on single onchange() but when i fetch value on next page it will generate null pointer exception .The code is here........... function disease_desc(id,type,desc) { alert(id); alert(type); alert(desc); var xmlHttp; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { //alert(xmlHttp.responseText); document.getElementById("b").innerHTML = xmlHttp.responseText; } } xmlHttp.open("GET","Drug_Interaction_Panel_Ajax.jspid="+id+"&type="+type+"&desc="+desc,true); xmlHttp.send(null); } function disease_drug(id,type,value) { alert(id); alert(type); alert(value); var xmlHttp; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { //alert(xmlHttp.responseText); document.getElementById("d").innerHTML = xmlHttp.responseText; } } xmlHttp.open("GET","Drug_Interaction_Panel_Ajax.jspid="+id+"&type="+type+"&value="+value,true); xmlHttp.send(null); } Now the function calling......... MOD EDIT: When posting code...USE CODE TAGS!!! This post has been edited by JackOfTrades: 13 September 2010 - 12:50 PM
VIEWS ON THIS POST

331

Posted on:

Monday 26th November 2012
View Replies!