jQuery Plugins » database https://jqueryplugins.info jQuery plugins, tutorials and resources Mon, 24 Oct 2011 22:14:14 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Why does this insert into database without http:// but not insert with the http:// codeigniter, ajax, jquery, json https://jqueryplugins.info/2011/10/why-does-this-insert-into-database-without-http-but-not-insert-with-the-http-codeigniter-ajax-jquery-json/ https://jqueryplugins.info/2011/10/why-does-this-insert-into-database-without-http-but-not-insert-with-the-http-codeigniter-ajax-jquery-json/#comments Sat, 22 Oct 2011 17:14:39 +0000 Admin https://jqueryplugins.info/2011/10/why-does-this-insert-into-database-without-http-but-not-insert-with-the-http-codeigniter-ajax-jquery-json/ Post link: Why does this insert into database without http:// but not insert with the http:// codeigniter, ajax, jquery, json

I am really stumped with this one.. I need to insert a site_title, site_address (the url) site_description & site_category into my database from the front-end with jquery/json.. It inserts the...

]]>
Post link: Why does this insert into database without http:// but not insert with the http:// codeigniter, ajax, jquery, json

I am really stumped with this one.. I need to insert a site_title, site_address (the url) site_description & site_category into my database from the front-end with jquery/json.. It inserts the site and updates the frontend fine if I do not put the “http://” in the site_address input field but as soon as I do, it will not inster to the database..

This is something I require but cannot understant whats up..

I have this code

FORM IN HOME VIEW:

            <form action="" method="post" class="addsite_form">
                <input id="account_id" type="hidden" value="<?php echo $  this->session->userdata('account_id');?>"/>
                <label for="site_title"><strong>Site Name:</strong></label>
                <input id="site_title" type="text" maxLength="25" tabindex="1" name="site_title" />
                <label for="site_address"><strong>Site Address:</strong></label>
                <input id="site_address" type="text" tabindex="2" name="site_address" />
                <label for="site_description"><strong>Site Description:</strong></label>
                <input id="site_description" type="text" tabindex="3" name="site_description" />
                <label for="site_category"><strong>Site Category:</strong></label>
                <input id="site_category" type="text" tabindex="4" name="site_category" /> 

                <input id="addsite_form_submit" type="submit" value="Add Site" name="submit" tabindex="5" /> 

            </form>

CONTROLLER

            public function addUserSites() {

                $  account_id = $  this->input->post('account_id');
                $  site_title = $  this->input->post('site_title');
                $  site_description = $  this->input->post('site_description');
                $  site_address = $  this->input->post('site_address');
                $  site_category = $  this->input->post('site_category');

                $  array = array(
                    'account_id' => $  account_id,
                    'site_title' => $  site_title,
                    'site_description' => $  site_description,
                    'site_address' => $  site_address,
                    'site_category' => $  site_category,

                );

              echo json_encode($  this->usersites_model->insertsites($  array));

            }

MODEL:

            public function insertsites($  data)  {

                 $  this->db->insert('usersites', $  data);

                 return TRUE; 

            }

JQUERY

            $  ('.addsite_form').submit(function() {
                var account_id = $  ("#account_id").val();
                var site_title = $  ("#site_title").val();
                var site_address = $  ("#site_address").val();
                var site_description = $  ("#site_description").val();
                var site_category = $  ("#site_category").val();

            $  .post("/usersites/addusersites", { 

                "account_id" : account_id,
                "site_title" : site_title,
                "site_address" : site_address,
                "site_description" : site_description,
                "site_category" : site_category,
                },

                function(data){
                     }, "json");
            });

It has taken me 2 days straight to get this far :/ lol.. I hope that someone can help and put my utter noobness to shame!

Cheers,

Danny..

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/why-does-this-insert-into-database-without-http-but-not-insert-with-the-http-codeigniter-ajax-jquery-json/feed/ 0
Change sortorder in database using jstree and asp.net mvc https://jqueryplugins.info/2011/10/change-sortorder-in-database-using-jstree-and-asp-net-mvc/ https://jqueryplugins.info/2011/10/change-sortorder-in-database-using-jstree-and-asp-net-mvc/#comments Wed, 19 Oct 2011 08:13:10 +0000 Admin https://jqueryplugins.info/2011/10/change-sortorder-in-database-using-jstree-and-asp-net-mvc/ Post link: Change sortorder in database using jstree and asp.net mvc

I’m trying to change the sortorder in a database table looking like this : id parentid sitename sortorder 1 0 home 0 2 0 about 1 3 0 product 2...

]]>
Post link: Change sortorder in database using jstree and asp.net mvc

I’m trying to change the sortorder in a database table looking like this :

id parentid sitename sortorder
1  0        home     0
2  0        about    1
3  0        product  2
4  0        contact  3

Now when i drag “home” down between “product” and “contact” using jstree, I need to change the sortorder of all 4 sites. The thing i know when I drop the “home” site is the id, parentid and the new sortorder-index, but how would my update linq sql look like to get this to work?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/change-sortorder-in-database-using-jstree-and-asp-net-mvc/feed/ 0
How to interact with database by using jQuery https://jqueryplugins.info/2011/10/how-to-interact-with-database-by-using-jquery/ https://jqueryplugins.info/2011/10/how-to-interact-with-database-by-using-jquery/#comments Thu, 06 Oct 2011 11:23:05 +0000 Admin https://jqueryplugins.info/2011/10/how-to-interact-with-database-by-using-jquery/ Post link: How to interact with database by using jQuery

I have an annoying problem. I use the autocomplete extender provided by ASP.NET in my Web Forms application written in C#. The autocomplete works good, no problem. I use the...

]]>
Post link: How to interact with database by using jQuery

I have an annoying problem. I use the autocomplete extender provided by ASP.NET in my Web Forms application written in C#. The autocomplete works good, no problem.

I use the autocomplete with the serial_number textfield. If I want to fill in the product_name textfield based on what serial_number I have chosen I need to interact with the database.
That is because the Web Method that provides data to the autocomplete must have a specific signature and its output parameters is an array of strings.

Therefore once the serial_number is selected, I need to call a jQuery function that given the selected serial_number gets the corresponging product_name from the database (SQL Server).

Any suggestion? Thanks

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-interact-with-database-by-using-jquery/feed/ 0
Echo data from database in each times get https://jqueryplugins.info/2011/09/echo-data-from-database-in-each-times-get/ https://jqueryplugins.info/2011/09/echo-data-from-database-in-each-times-get/#comments Tue, 27 Sep 2011 11:16:21 +0000 Admin https://jqueryplugins.info/2011/09/echo-data-from-database-in-each-times-get/ Post link: Echo data from database in each times get

I send three times values 1 & 2 & 3 by jquery.serialize() for $ hotel_id in PHP, now i want get in the each times from send, data linked with...

]]>
Post link: Echo data from database in each times get

I send three times values 1 & 2 & 3 by jquery.serialize() for $ hotel_id in PHP, now i want get in the each times from send, data linked with $ hotel_id(like: 1 or 2 or 3) from database. but in the following code i just get data that linked to last $ hotel_id(3).

I want as:

First: get data linked with 1 and echo they in json_encode
Second: (next 2) get data linked with 2 and echo they in
json_encode
Third: (next 3)get data linked with 3 and echo
they in json_encode

This is output serialize() from jQuery code:

hotel_id=1&hotel_id=2&hotel_id=3

This is my php code:

$  hotel_id = $  this->input->post('hotel_id');
$  query_r  = $  this->db->query("SELECT * FROM hotel_submits WHERE id LIKE '$  hotel_id' ORDER BY id desc");
$  data     = array();
foreach ($  query_r->result() as $  row) {
    $  data_s  = json_decode($  row->service, true);
    $  data_rp = json_decode($  row->address, true);
    $  data[]  = array(
        'name' => $  row->name,
        'star_type' => $  row->star . '-' . $  row->type,
        'site' => $  row->site,
        'service' => $  data_s,
        'address' => $  row->address
    );
}
echo json_encode($  data);

How do i do?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/echo-data-from-database-in-each-times-get/feed/ 0
Save Dragable sitemap with jquery to database https://jqueryplugins.info/2011/09/save-dragable-sitemap-with-jquery-to-database/ https://jqueryplugins.info/2011/09/save-dragable-sitemap-with-jquery-to-database/#comments Wed, 21 Sep 2011 12:20:32 +0000 Admin https://jqueryplugins.info/2011/09/save-dragable-sitemap-with-jquery-to-database/ Post link: Save Dragable sitemap with jquery to database

I have a question, i found a great script that i want to use for my website but i don`t know how to save it to my database, the link...

]]>
Post link: Save Dragable sitemap with jquery to database

I have a question,
i found a great script that i want to use for my website but i don`t know how to save it to my database, the link is, could someone point me to the right direction?
Thanks

http://boagworld.com/technology/creating-a-draggable-sitemap-with-jquery/

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/save-dragable-sitemap-with-jquery-to-database/feed/ 0
Communication by JSFIDDLE with PHP code and database on server https://jqueryplugins.info/2011/09/communication-by-jsfiddle-with-php-code-and-database-on-server/ https://jqueryplugins.info/2011/09/communication-by-jsfiddle-with-php-code-and-database-on-server/#comments Sun, 11 Sep 2011 15:22:44 +0000 Admin https://jqueryplugins.info/2011/09/communication-by-jsfiddle-with-php-code-and-database-on-server/ Post link: Communication by JSFIDDLE with PHP code and database on server

I want communication by JSFIDDLE (jQuery AJAX call => url:…) with PHP code in my server but have following error. An error has occured: [object Object] error Demo: http://jsfiddle.net/mmJNq/ what...

]]>
Post link: Communication by JSFIDDLE with PHP code and database on server

I want communication by JSFIDDLE (jQuery AJAX call => url:…) with PHP code in my server but have following error.

An error has occured:
[object Object]
error

Demo: http://jsfiddle.net/mmJNq/

what do i do?

$  ('.eghamat').live('keyup', function () {
    var $  this = $  (this),
        $  div = $  this.closest('div.bg_units'),
        bu_num = '.' + $  div.attr('class').split(" ")[1];
    var dataObj = $  (this).closest('form').serialize();
    //alert(dataObj);
        $  .ajax({
            type: "POST",
            dataType: 'json',
            url: 'http://binboy.gigfa.com/admin/tour_foreign/auto_complete',
            //url: 'auto_complete',
            data: dataObj,
            cache: false,
            success: function (data) {
                //alert(bu_num);
                var id_name = $  (bu_num + ' .list_autobox_hotel').attr('id');
                $  (bu_num + ' .list_autobox_hotel').show().html('');
                if (data == 0) {
                    $  (bu_num + ' .list_autobox_hotel').show().html('<p><b>there is no</b></p>');
                } else {
                    $  .each(data, function (index, value) {
                        $  ('<p id="' + value.name + '">' + value.name + '</p>').appendTo('.list_autobox_hotel');
                    });
                }
            },
            "error": function (x, y, z) {
                // callback to run if an error occurs
                alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
            }
        });
});

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/communication-by-jsfiddle-with-php-code-and-database-on-server/feed/ 0
Form autofill if value exist in database using AJax https://jqueryplugins.info/2011/09/form-autofill-if-value-exist-in-database-using-ajax/ https://jqueryplugins.info/2011/09/form-autofill-if-value-exist-in-database-using-ajax/#comments Tue, 06 Sep 2011 08:19:29 +0000 Admin https://jqueryplugins.info/2011/09/form-autofill-if-value-exist-in-database-using-ajax/ Post link: Form autofill if value exist in database using AJax

I have a form I need to auto fill it using Ajax and php. Suppose My unique field is mobile number. So when form appears firstly person has to fill...

]]>
Post link: Form autofill if value exist in database using AJax

I have a form I need to auto fill it using Ajax and php. Suppose My unique field is mobile number. So when form appears firstly person has to fill mobile number. If mobile number exist in the database than all the rest field retrieve its value that is his name, email etc, making all the text fields disable.

my approach to this work is on blur effect I can send value through AJAX. but how call values in array. I have called only single value through echo; but have not called array back from java script page.

Secondly I need jquery to fill all form with respective values and disable particular fields in form.

Give me some more idea to make this approach better and provide some hint to implement it efficiently.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/form-autofill-if-value-exist-in-database-using-ajax/feed/ 0
MVC3 Cascade DropDownList pre-select values from database https://jqueryplugins.info/2011/09/mvc3-cascade-dropdownlist-pre-select-values-from-database/ https://jqueryplugins.info/2011/09/mvc3-cascade-dropdownlist-pre-select-values-from-database/#comments Sun, 04 Sep 2011 17:19:51 +0000 Admin https://jqueryplugins.info/2011/09/mvc3-cascade-dropdownlist-pre-select-values-from-database/ Post link: MVC3 Cascade DropDownList pre-select values from database

I’ve implemented a cascade dropdown list using jQuery and AJAX. This works fine on creating item, but I need to pre-select values from database when I edit existing item. I’ve...

]]>
Post link: MVC3 Cascade DropDownList pre-select values from database

I’ve implemented a cascade dropdown list using jQuery and AJAX. This works fine on creating item, but I need to pre-select values from database when I edit existing item. I’ve tried to create a SelectList with pre-selected value from model, but that worked on the first dropdownlist only.

How can I make other lists showing item Area and Category values?

Here’s my jQuery code:

 <script type="text/javascript">
$  (document).ready(function() {

    $  ("#ddlDeps").change(function() {
        var idArea = $  (this).val();
        $  .getJSON("/Admin/LoadAreasByDepartment", { id: idArea },
            function(depData) {
                var select = $  ("#ddlAreas");
                select.empty();
                select.append($  ('<option/>', {
                        value: 0,
                        text: "Выберите направление"
                    }));
                $  .each(depData, function(index, itemData) {

                    select.append($  ('<option/>', {
                            value: itemData.Value,
                            text: itemData.Text
                        }));
                });
            });
    });

    $  ("#ddlAreas").change(function() {
        var idCategory = $  (this).val();
        $  .getJSON("/Admin/LoadCategoriesByArea", { id: idCategory },
            function(areaData) {
                var select = $  ("#ddlCategories");
                select.empty();
                select.append($  ('<option/>', {
                        value: 0,
                        text: "Выберите категорию"
                    }));
                $  .each(areaData, function(index, itemData) {

                    select.append($  ('<option/>', {
                            value: itemData.Value,
                            text: itemData.Text
                        }));
                });
            });
    });
});

And this is my cascasing dropdownlist code:

   <p>
    @Html.DropDownListFor(model => model.DepartmentId, new SelectList(Model.DataContainer.Departments, "Id", "Name"),
                            "Выберите отдел", new {id = "ddlDeps"})
    @Html.ValidationMessageFor(model => model.DepartmentId)
</p>
<p>

    @{
        var areaSelectList = new SelectList(Enumerable.Empty<SelectListItem>(), "DepartmentId", "Title", Model.AreaId);
        var categorySelectList = new SelectList(Enumerable.Empty<SelectListItem>(), "AreaId", "Title", Model.CategoryId);
    }
    @Html.DropDownListFor(model => model.AreaId, areaSelectList,
                            "Выберите направление", new {id = "ddlAreas"})
    @Html.ValidationMessageFor(model => model.AreaId)
</p>
<p>
    @Html.DropDownListFor(model => model.CategoryId, categorySelectList,
                            "Выберите категорию", new {id = "ddlCategories"})
</p>

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/mvc3-cascade-dropdownlist-pre-select-values-from-database/feed/ 0
How to set up tooltips using database information? https://jqueryplugins.info/2011/08/how-to-set-up-tooltips-using-database-information/ https://jqueryplugins.info/2011/08/how-to-set-up-tooltips-using-database-information/#comments Tue, 30 Aug 2011 01:01:36 +0000 Admin https://jqueryplugins.info/2011/08/how-to-set-up-tooltips-using-database-information/ Post link: How to set up tooltips using database information?

Question by Nyah Kon: How to set up tooltips using database information? I already have a database in place with thousands of entries. What I want to do is enable...

]]>
Post link: How to set up tooltips using database information?

Question by Nyah Kon: How to set up tooltips using database information?
I already have a database in place with thousands of entries.

What I want to do is enable tooltips that pop up when you hover over a link to each entry.

For example, look at http://aoc.yg.com/tooltips and hover over “Axe of Red Ruin”

How do I go about setting something like this up? Is it done with jquery? I don’t have experience with this kind of stuff, so if you could reference me to a site with clear instructions I would really appreciate it.

Thank you.

Best answer:

Answer by Itison
Handling the actual tooltips can be done with JavaScript; I’ve put a tutorial below as a source. Getting the data from your DB to put in your tooltips is a different issue… of course it depends on what is installed on your host. You should check with them to see what server-side languages are available. Otherwise, if you’re hosting locally, you can always installed PHP or whatever will support the DB you use.

Give your answer to this question below!

]]>
https://jqueryplugins.info/2011/08/how-to-set-up-tooltips-using-database-information/feed/ 0
Newsletter/mailing list for asp.net 3.5/4.0, sql server database , visual studio 2010? https://jqueryplugins.info/2011/08/newslettermailing-list-for-asp-net-3-54-0-sql-server-database-visual-studio-2010/ https://jqueryplugins.info/2011/08/newslettermailing-list-for-asp-net-3-54-0-sql-server-database-visual-studio-2010/#comments Mon, 29 Aug 2011 09:55:50 +0000 Admin https://jqueryplugins.info/2011/08/newslettermailing-list-for-asp-net-3-54-0-sql-server-database-visual-studio-2010/ Post link: Newsletter/mailing list for asp.net 3.5/4.0, sql server database , visual studio 2010?

Question by Superchick: Newsletter/mailing list for asp.net 3.5/4.0, sql server database , visual studio 2010? Hi guys I really need help. My team created a website in visual studio using...

]]>
Post link: Newsletter/mailing list for asp.net 3.5/4.0, sql server database , visual studio 2010?

Question by Superchick: Newsletter/mailing list for asp.net 3.5/4.0, sql server database , visual studio 2010?
Hi guys

I really need help. My team created a website in visual studio using asp.net/ajax/jquery/vb.net

My job is creating a newsletter section. Im really having difficulty finding some source code for this. Im not a good coder so I unfortunately cant code it myself. I really need assistance

Can someone please help me? Maybe direct me to a relevant site. Ive been searching for hours and found nothing to assist me

Thanks
I understand code (kinda), but not an expert.

I want to make a textbox where users enter their email and click submit to subscribe to a newsletter. They get an email to confirm their email address. Thus validation is complete and their email address gets added to the database.

I just suck at coding thats all (yea i know its sad) and most of the source code i found had php..ms access etc, which i dont want

Best answer:

Answer by Danny Ocampo
kill bill

Know better? Leave your own answer in the comments!

]]>
https://jqueryplugins.info/2011/08/newslettermailing-list-for-asp-net-3-54-0-sql-server-database-visual-studio-2010/feed/ 1