Jquery and php

Javascript coding ..

Moderators: macek, egami, gesf

michblam
New php-forum User
New php-forum User
Posts: 3
Joined: Sun Nov 20, 2011 5:20 pm

Jquery and php

Postby michblam » Sun Nov 20, 2011 5:27 pm

hi.. i need your help.. i’m new in jquery..please help me.. how can I get the value of the text box in the modal dialog and insert it in mysql using php.. thanks.. here is the code that i used..



<!DOCTYPE html>
<html>
<head>

<link type="text/css" href="js/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>

<script>



$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
});
$( "#create" )
.button()
.click(function() {
$( "#dialog" ).dialog("open");


});

$( "#button" )
.button()
.click(function() {
$( "#dialog" ).dialog("close");
});

});

</script>


</head>
<body style="font-size:62.5%;">


<div id="dialog" title="Dialog Title">
<form>
Year:
<label>
<select name="select" id="select">
<option value="null"> Select Year </option>
<option value="1">First Year</option>
<option value="2">Second Year</option>
<option value="3">Third Year</option>
<option value="4">Fourth Year</option>
</select>
</label><br/><br/>
Section:
<input name="section" >
<br/><br/>

<button id="button" name="submit">Submit</button>
</form>
</div>
<div> <button id="create">Create new user</button></div>


</body>
</html>

User avatar
WebOutGateway
New php-forum User
New php-forum User
Posts: 37
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines
Contact:

Re: Jquery and php

Postby WebOutGateway » Mon Jul 28, 2014 1:26 am

Hi, michblam!

You can retrieve the values by using the POST or GET method.

You can check these out as your reference:

http://www.phponwebsites.com/2014/03/php-mysql-insert-data-into-table.html
http://www.w3schools.com/php/php_forms.asp

I hoe this helps. Thank you.


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 0 guests