AleMonteiro 238 Can I pick my title?

Try using live:

 $(".replaced").live("click", function() {

    alert("Yeah!");

 });

Using 'click' will only attach handlers to existing objects. Using 'live' it'll attach the handlers to any existing object and also for objects created latter.

AleMonteiro 238 Can I pick my title?

No, I didn't. Since those are the files that I need to make it work, I gone right into it.

What did you mean by SO, sorry but I didn't undestand the abreviation.

Any way, I'll make some tests with simple text and post back the results.

AleMonteiro 238 Can I pick my title?

Ok, since you are using connected lists, listen to the receive event and when it occurs, validate if there's another item in the target. If there is, you can either remove the old one or the new one.

http://api.jqueryui.com/sortable/#event-receive

AleMonteiro 238 Can I pick my title?

I think i made it:

<html>
    <style>
#top_menu_wrapper
{
    border: 2px solid green;
    width:600px;
    height:100%;
    float:right;
    text-align:left;
    padding:50px;
}

#top_menu_wrapper ul
{
    list-style-type: none; /*remove bullets*/
    text-align: right;
}

#top_menu_wrapper li 
{ 
    display: -moz-inline-stack;
    display: inline-block;
    zoom: 1; /* for IE */
    *display: inline;  /* for IE 6 e 7 */
}

#top_menu_wrapper li a 
{   
    padding: 0 15px; 
} 

#search_bar input[type="text"] {
    background: url(../IMAGE/search-white.png)no-repeat 10px 5px #444;
    border: 0 none;
    font: bold 12px Arial,Helvetica,Sans-serif;
    color: #d7d7d7;
    width:150px;
    padding: 6px 15px 6px 35px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3); 
    -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
    -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
    -webkit-transition: all 0.7s ease 0s;
    -moz-transition: all 0.7s ease 0s;
    -o-transition: all 0.7s ease 0s;
    transition: all 0.7s ease 0s;

    }

#search_bar input[type="text"]:focus {
    background: url(../IMAGE/search-dark.png) no-repeat 10px 5px #fcfcfc;
    color: #6a6f75;
    width: 200px;
    -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
    -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    }
    </style>

    <body>
        <div id = 'header_wrapper'>
            <div id = 'logo_wrapper'>
                <h1><a href='index.php'>ECOMMERCE SITE</a></h1>
AleMonteiro 238 Can I pick my title?

You post your code and what it should do, but you didn't say what the problem is.

What dificulties are you having?

AleMonteiro 238 Can I pick my title?

The link is broken, can't see anything.

In any case, take a look at jQUery UI Drag & Drop: http://jqueryui.com/droppable/

AleMonteiro 238 Can I pick my title?

Try this way:

<div id = 'top_menu_wrapper'>
    <form  id='search_bar' action='Config_FullStoreURLSearchResults.asp' method='get' name='SearchBoxForm'>
        <ul>
            <li><a href='#'>Log In</a></li>
            <li><a href='#'>Register</a></li>
            <li><a href='#'>About Us</a></li>
            <li><input type='text' name='Search' id='search_input' value='Search...'/></li>        
        </ul>
    </form>
</div>
AleMonteiro 238 Can I pick my title?

Hi.

yes, it's possible to do it with JQuery. In fact, jQuery it's the easiest way to do it.

You'll need the html strucutre for the window, the css to add style to the window and jQuery to open, close and manage the window.

Google a little bit about JQuery PopUp Window that you'll find a lot of things.

If you don't want to code much I suggest that you use jQuery UI Dialog.
http://jqueryui.com/dialog/

AleMonteiro 238 Can I pick my title?

Hi everybody.

I'm building an site that will load a bunch of overlays into Google Maps. The overlays are static and already in JSON format to be loaded with AJAX.
This all works fine, ajax request, json parse, adding overlay.

But the json files are quite big, the largest has almost 5mb. So I Gziped it, and the size drop to about 2mb.

The problem is loading the GZip file with AJAX. I can't make it work.

For what I readed, the browser that should decompress the gzip file, but it ain't happening.
So I tried to use a function that I found on the web, but it ain't working neither.

This is my code till now:

    function testGZip() {
        $.ajax({
            url: "Feijo.json.gz",
            success: function (result) {
                var decoded = lzw_decode(result);
                var object = JSON.parse(str);
            }
        });
    }

    // Decompress an LZW-encoded string
    // Code From http://jsolait.net/
    function lzw_decode(s) {
        var dict = {};
        var data = (s + "").split("");
        var currChar = data[0];
        var oldPhrase = currChar;
        var out = [currChar];
        var code = 256;
        var phrase;
        for (var i = 1; i < data.length; i++) {
            var currCode = data[i].charCodeAt(0);
            if (currCode < 256) {
                phrase = data[i];
            }
            else {
                phrase = dict[currCode] ? dict[currCode] : (oldPhrase + currChar);
            }
            out.push(phrase);
            currChar = phrase.charAt(0);
            dict[code] = oldPhrase + currChar;
            code++;
            oldPhrase = phrase;
        }
        return out.join("");
    }

The Gzip file it's avaiable here if anyone wants to try it:

AleMonteiro 238 Can I pick my title?

I wouldn't bother with that, it's not a bug, it's an IE performance problem.

IE is pretty slow compared with other browsers, speacially Firefox and Google Chrome.

What could be done is improve the plugin performance itself, then it would load faster in IE and even faster in the other browsers.

Another thing that you could do is alert the user that he should use another browser, or at least update IE to 9 or 10 (9 is faster than 8, and 10 it's faster than 9).

I'd say that IE 10 performance is almost ok in comparisson with other browsers.

AleMonteiro 238 Can I pick my title?

Try this, and make sure that the image path does exists.

function vote(id)
{ 
    var ajax_image = "<img src='_assets/images/tire-loader.gif' alt='Loading...' />";

     $('#sub-cat').html(ajax_image);

     $.ajax({
        type: "POST",
        url: "ajax.php",
        data: "id="+id,
        async: true,
        success: function(result) {
            result = result.responseText.split("^");
            $('#sub-cat').html(result[0]);
            $('#sub-cat').html(result[1]);     
        }
     });
}
AleMonteiro 238 Can I pick my title?

Did you test if the mouseUp Listener is being triggered?

Just to make sure, mouseUp is triggered when then user click and let go. Is that what you want?

Another thing, Hover expects two functions. Because Hover is a bind for mouseOver and mouseLeave.

And, if you want mouseUp, you don't need mouseOver.

So, either remove the Hover or change it to MouseOver. I suggest you remove it.

AleMonteiro 238 Can I pick my title?

You are probably missing a namespace reference.

using System.Data

AleMonteiro 238 Can I pick my title?

SPeed, it's seems to me that this is Java and not JavaScript.

AleMonteiro 238 Can I pick my title?

You could just split the values of the text box.

Something like this:

    string[] lines = Regex.Split(textValue, @"\n\r");

    foreach (string line in lines)
    {
        // Do what you want
    }
AleMonteiro 238 Can I pick my title?

ahteck,

by what I see, your query is already returning all students allocated for the supervisor.
If you debug your code, it may enter While dr.Read() more than once. This means that in the end, the labels will have the value of the last student returned by the query.

One solution to your problem is to use a DataSet so you can get the returned rows by an index. So in the first case you'll use index 0, in the second, index 1 and so on.

An example (in c#, cause I don't have any code written in VB)

DataSet        ds        = new DataSet();
SqlDataAdapter adapter;

adapter = new SqlDataAdapter( cmd );
adapter.Fill( ds );

cmd.Dispose();

adapter.Dispose();
adapter = null;

DataTable table = ds.Tables[0];

int numStudents = table.Rows.Count;

// First Student

table.Rows[0]["StName"].ToString()
table.Rows[0]["StId"].ToString()

// Second Student

table.Rows[1]["StName"].ToString()
table.Rows[1]["StId"].ToString()

This code assume that cmd is already created with the query.

AleMonteiro 238 Can I pick my title?

I use Notepad++ too, for more than 5 years now, and it never let me down.
Notepad++ does not generate any garbage, because it's only a text editor.

Editors that generate garbage are WYSIWYG (What You See Is What You Get), like dream weaver, front-page and others.

I don't recomend using WYSIWYG for any developer, specially a beginer.

If you want to learn, you have to code.

AleMonteiro 238 Can I pick my title?

Can you post a diagram with the used tables so we can analyse it?

AleMonteiro 238 Can I pick my title?

I've been using Assembla for almost two years now, and I recommend. I didn't have any problem with it and it's pretty easy to understand and use.

We started with a free account for a single project, today we have a payed plan and more than 20 projects in it.

AleMonteiro 238 Can I pick my title?

Even then you could do it with JavaScript. The server can decide what to show and the JavaScript does the job of showing it (creating the DOM).

Either way, it should work.

If you don't have any more problems with the popover plugin, please mark as solved.

If you have futher problems with your implementation, it's better to create another topic, unless it is directly related with the popover plugin.

Seeya.

AleMonteiro 238 Can I pick my title?

As shown at msdn the TextBox does have a Text property.

So, int.Parse( txtQty.Text ); should work.

AleMonteiro 238 Can I pick my title?

But why do you need to generate it on the server? Can't you do it on the interface?

AleMonteiro 238 Can I pick my title?

You'll need it to work. No matter where the string is generated, it always need to be valid.

AleMonteiro 238 Can I pick my title?

Try this:

$(function(){

                $("#btn").click(function(event) {

                    event.preventDefault();
                    event.stopPropagation();

                    $("#btn").popover({
                        title: "Dynamic content",
                        content: '<div class="popover fade bottom in" style="top: 154px; left: 517px; display: block;">'+
                                    '<div class="arrow"></div>' +
                                    '<div class="popover-inner">' +
                                        '<h3 class="popover-title">Words Found</h3>' +
                                        '<div class="popover-content">' +
                                            '<p class="innerHTML" style="overflow:auto;max-height:120px;">' +
                                                '<span class="overflow" style="overflow:hidden;width:30px;">' +
                                                    '<button class="replaced btn btn-primary" type="button" id="hullo"> hullo </button>' +
                                                '</span>' +
                                            '</p>' +
                                        '</div>  ' +
                                    '</div>' +
                                '</div>', 
                        html: true 
                    })
                    .popover("show");

                    $("#hullo").click(function() {
                        alert("yeah");
                    });

                });
            });
AleMonteiro 238 Can I pick my title?

Adrian, you don't seem to be understanding what we are saying.

(TextBox)dlProducts.Controls[0].FindControl("txtProductQty") will return an TextBox, NOT A INT.

The int value will be in the Value/Text of the TextBox.
Do as I said before:

TextBox txtQty = (TextBox) dlProducts.Controls[0].FindControl("txtProductQty");
int qty = int.Parse( txtQty.Value );
//OR
int qty = int.Parse( txtQty.Text );
AleMonteiro 238 Can I pick my title?

What do you mean? I didn't understand your problem.

A input adress is a text input: <input type="text" name="adress" id="txtAdress" />

What are you looking for?

AleMonteiro 238 Can I pick my title?

It would be ideal if the companies had an webservice that returned the prices, but I don't think they'll have it.

Another way, if you have the site that shows the info, is to load the HTML from the site and then parse it to find the info you want.
The bad thing about this is that each time they change their sites you'll have to change your parser.

AleMonteiro 238 Can I pick my title?

Hi,

the code dlProducts.Controls[0].FindControl("txtProductQty") will return an TextBox and not an value.

Do it by steps, to see what is going wrong. Example:

TextBox txtQty = dlProducts.Controls[0].FindControl("txtProductQty");
int qty = txtQty.Value;

Debug the code and see if the textbox is found, if it is then you'll get the value.

I don't know if the class name is exatcly TextBox, it may be HTMLTextBox or something like that.

AleMonteiro 238 Can I pick my title?

Please post a complete example of what you are trying to do. With the HTML, JS and CSS.
An example that I can test and debug to try and find your problem.

AleMonteiro 238 Can I pick my title?

I don't think that anyone will code that for you. The forum is for help and discussion, not for us to code for you.

If you want help you'll get it, but if you want somebody to do the job for you, you won't.

AleMonteiro 238 Can I pick my title?

You are welcome.

Mark the tread as solved please.

AleMonteiro 238 Can I pick my title?

You are welcome.

If that's it, mark as solved please.

AleMonteiro 238 Can I pick my title?

Your HTML is invalid too, there's no closing tag for the '<span>'

AleMonteiro 238 Can I pick my title?

This should do the trick:

var lastSelection = undefined;

function handleSelection(choice) {
    document.getElementById('select').disabled=false;
    document.getElementById(choice).style.display="block";

    if ( lastSelection != undefined ) {
        document.getElementById(lastSelection).style.display="none";
    }

    lastSelection = choice;
}
AleMonteiro 238 Can I pick my title?

You'll need a server-side language to make the file upload and read it's content.
The rest is possible to do with JavaScript, and I think there's lots of code sinepts for code highlight over the web.

AleMonteiro 238 Can I pick my title?

Using IFrame the interaction between the apps will be very limited, sepecially if they're loaded from different domains.

I'd certainly create it directly into the OS, the main reasons would be control, interaction and extensibility using prototype.

AleMonteiro 238 Can I pick my title?

Your problem is that your radio buttons have different names. A group of radio buttons are defined by the radios name.

Check this example:

<html>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

    <script>
        $(function(){
            $("#btnCheck").click(function(){
                alert("Selected Value: " + $("input[name=sex]:checked").val());
            });
        });
    </script>

    <body>
        <input type="radio" name="sex" value="M" /> Male
        <input type="radio" name="sex" value="F" /> Female
        <button type="button" id="btnCheck">Check It</button>
    </body>
</html>

Another thing, posting the full source is not a good idea. Not because you may not like it, but because the number of people with patience and good will to read all of it is very low. I mean, the bigger the code you post, fewer people will read.

AleMonteiro 238 Can I pick my title?

Are you using checkbox? With checkbox the user will be able to selected more than one sex.
Isn't radio button that you need?

AleMonteiro 238 Can I pick my title?

A doubt, the input sex is of what kind? A checkbox, radio button?

AleMonteiro 238 Can I pick my title?

Why don't host on your PC and share your IP with him (you may have to configure your firewall and router, if any)

AleMonteiro 238 Can I pick my title?

Try $('.sex').is(':checked')

AleMonteiro 238 Can I pick my title?

Seems to work fine. I did a test with the demo page on the popover site:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />

        <title>jQuery.popover demo page</title>
        <link rel="stylesheet" href="_page.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="popover.css" type="text/css" media="screen" />

        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript" src="jquery.popover-1.1.2.js"></script>
        <script type="text/javascript">
        /* <![CDATA[ */
            $(function(){

                $("#btn").click(function(event) {

                    event.preventDefault();
                    event.stopPropagation();

                    $("#btn").popover({
                        title: "Dynamic content",
                        content: '<span id="spn">Testing</span>',
                        html: true
                    }).popover("show");

                    $("#spn").html("Yeah!!!!");

                });
            });
        /* ]]> */
        </script>
    </head>
    <body>

        <a href="#" id="btn">Click me</a>

    </body>
</html>
AleMonteiro 238 Can I pick my title?

I think I understand it now.

Check this out: http://www.dotnetperls.com/count-letter-frequencies

I think it'll get you started.

AleMonteiro 238 Can I pick my title?

Let's think about the table as an excel sheet, where the cells are A1, A2, B1, B2 and etc.

A1 is clicked (with value 1) A1 will become 0 and B1 will become 2.
B1 is clicked (with value 2) B1 will become 0, C1 will become 2 and B2 will become 2.

Is that right?

AleMonteiro 238 Can I pick my title?

There's no 'E' in the this message.
Please explain how do you need to handle the message. What information you need to extract?
Explain the message layout so we can be of help.
Or you just want to convert the string to an char array?

AleMonteiro 238 Can I pick my title?

Post a file example so that we can see that kind a text you are reading.

AleMonteiro 238 Can I pick my title?

This should do the trick:

"(class)([\s\t ]+)(\w*)([\s\t\r\n ]*?)({+)"

$1 = class word
$2 = space between 'class' and the class name
$3 = class name
$4 = space between the class name and the '{'
$5 = the first '{' after the class name
AleMonteiro 238 Can I pick my title?

Let me see if I understand: Even if the page doesn't fill the body height, you want the footer to be at the bottom. And when the page fill the body height, or get bigger than it, you want the footer to stay at the bottom of the page (bottom of the page, not bottom of the window).

Is that right?

AleMonteiro 238 Can I pick my title?

Did it solve your problem?

AleMonteiro 238 Can I pick my title?

Because "<span id="test">Test</span>" it's not a valid string.

Those would be valid strings:

"<span id=\"test\">Test</span>" // scape the inside double quotes
"<span id=test>Test</span>" // doesn't use inside double quotes
"<span id='test'>Test</span>" // use inside single quotes
'<span id="test">Test</span>' // use single quotes outside and double quotes inside
'<span id=\'test\'>Test</span>' // scape inside single quotes