AleMonteiro 238 Can I pick my title?

Try something like this...

if ( window.location.toString().indexOf("myPage.html") > -1 ) {
    window.onbeforeunload...
}
AleMonteiro 238 Can I pick my title?

Are you sure you are closing the connection in every case? For the description of the error you might be letting the connection open.

AleMonteiro 238 Can I pick my title?

Sorry mate, I really didn't understand what you want.
You want to fill an datagrid only with columns without data? What's the point? The datagrid would be empty.

AleMonteiro 238 Can I pick my title?

This page is the same page that show the HTML? If so, all this code is being executed before any user interaction...

I suggest that you create an hidden input to know what do to... example:

<?php
    if ( $_POST["formAction"] == "insert" ) {
        // Insert code goes here
    }
?>

<input type="hidden" name="formAction" value="none"/>

<button type="submit" onclick="document.form.formAction.value = 'insert'; return true;">Send</button>
AleMonteiro 238 Can I pick my title?

Hi, first of all, put some description at your post, don't just drop the code.

So the problem seems to be that you can execute the stored procedure, right? Do you have permission to do so with the account your are logged in? Who is the owner of the SP? Try using the fully classified name like 'dbo.regionSelect'.

AleMonteiro 238 Can I pick my title?

The App creates the DB and the tables, but it drops only the tables? If so, on the second time isn't it trying to create an DB that already exists?

And when the second project is created the first project tables are dropped, so the first project isn't available anymore?

Wouldn't it be better if the project tables were distinct? I mean, use a prefix... project_1_table_1, project_2_table_1...

AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?

What backend language are you using?

If you were able to show the list in HTML, just use an JQuery UI Theme to make the look and feel better.

AleMonteiro 238 Can I pick my title?

I was not able to undertand what you area trying to do... but let me explain to you what your code is doing...

// Every TR inside .contact-names will have and double click event listener
$(".contact-names tr").live("dblclick", function(){
    // Name will be any content displayed inside the row
     var name = $(this).text();
     // Every .input-name will have the value 'name', regardless of where the input is
     $(".input-name").val(name);
     // 'msg2' will be appended to every .tr
     $(".tr").append(msg2);
     // Any content inside the row clicked will be removed
     // This doesn't make much sense, because the 'msg2' appended will also be removed
     $(this).empty();    
});
AleMonteiro 238 Can I pick my title?

Where do you call the initialize function?
The error is telling you that you are trying to set the header after you started the output.

AleMonteiro 238 Can I pick my title?

That's because you can't make AJAX request to different domains.

Take a look at this: http://stackoverflow.com/questions/3506208/jquery-ajax-cross-domain

AleMonteiro 238 Can I pick my title?

I ain't sure, but I think you can't do it with backup (.bak).

What you can do it's generate scripts from the 2008 to the 2005:

1.Right click on the DB -> Tasks -> Generate Scripts
2.Select all the objects
3.Click Advanced
    3.1.Change Script for Server Version: SQL Server 2005
    3.2.Change Types of data to script: Schema and Data

If you don't have an working version of your DB in a 2008 enviorement, you'll need to create one.

Hope it helps.

Eagletalon commented: Solid working advice +3
AleMonteiro 238 Can I pick my title?

You can't really make transitions between two pages, but you can give a better impression with something like this.

// Hide your main div when leaving the page
window.onbeforeunload = function() {
    $("#myMainDiv").hide('fade');
};

// Shows your man div when loading the page
window.onload = function() {
    $("#myMainDiv").show('slide');
};
AleMonteiro 238 Can I pick my title?

I'm not sure, but I think this would work (C#):

object[] codeString = {"$('#practices).change();"};
webBrowser1.Document.InvokeScript("eval",codeString);
AleMonteiro 238 Can I pick my title?

You can't use the same id item for all the objects. The method getElementById always returned only the first object with that Id.
The <a> object doesn't have an value property. To get the text you need .innerText;

Try those changes:

$hint=$hint . "<br /><a id='item' href='javascript:void(0)' onClick='add(this)'>" . 
        $g->item(0)->childNodes->item(0)->nodeValue . "</a>";

And

var i=0;
function add(objA){    
        i++;  
        var title = objA.innerText;
        var node = document.createElement('div');        
        node.innerHTML = '<input type="checkbox" id="check' + i + '" name="check' + i + '"><label for="check' + i + '">' + title + '</label>';       
        document.getElementById('container').appendChild(node); 
}
AleMonteiro 238 Can I pick my title?

Put an alert($('.showproduct').find("div.product").length); on the showProductPage function and see what it says.

AleMonteiro 238 Can I pick my title?

The problem is that you are using the selector .image but it doesn't exist on your html.

Try this

function showProductPage( pageNo ) {
    var perPage = 2; T
    var start = pageNo * perPage; 
    var end = start + perPage; 
    $('.showproduct').find("div.product").hide().filter(function(index) { 
        return ( (index > (start-1)) && ( index < end ) ); 
    } ).show(); 
}
AleMonteiro 238 Can I pick my title?

The returned products. What does the var data hold?

AleMonteiro 238 Can I pick my title?

I'd suggest one of the two: PHP + MySQL or .NET + SQL Server
Both can achieve what you're looking for.

AleMonteiro 238 Can I pick my title?

The function showProductPage is fine.
Post one example of the data content.

One thing, you don't need '<\/div>', just '</div>' is fine.

AleMonteiro 238 Can I pick my title?

You need to add your logic that will define which option must be selected, then you set it to selected like this:

<select name="mySelect">
    <option value="1">First Option</option>
    <option value="2" selected>Second Option</option>
</select>
AleMonteiro 238 Can I pick my title?

I never used it, because I don't think it's functional. It sure is pretty and nice, but lack usability.

I'd use to build institucional websites, but I mostly work with BI systems.

AleMonteiro 238 Can I pick my title?

I suggest you use jQuery UI to achieve this, it'll be very easy.

Take a look in this demo, it's almost what you want: http://jqueryui.com/button/#splitbutton

This demo uses 3 jQuery UI feature: Button, Menu and Position.

<M/> commented: :) +7
AleMonteiro 238 Can I pick my title?

I've never used this effect, but I seached a little bit and came accross this post: http://javascripted.me/javascript-libraries-that-will-help-you-with-parallax-scrolling.html#.UVno2ZbDOSo

They show some options to use Parallex effects, take a look.

AleMonteiro 238 Can I pick my title?

Try using the insert like this:

INSERT INTO scores (StudentID,subjectid,classid) VALUES 
SELECT DISTINCT @studentID, SubjectID, @classid FROM Scores WHERE classid= @classid 
AleMonteiro 238 Can I pick my title?

Dani, now I noticed that the JavaScript demo uses another login page when the user is not logged on.

I think that will do =)

Thanks!

AleMonteiro 238 Can I pick my title?

Yes, It's difficult for me to login in daniweb in my Android phone, that's why I thought about the app.

Some bugs I encountered:
- Login dialog doesn't open (it just refreshs the page and doesn't open the dialog)
- Login dialog opens and closes immediately
- Login dialog opens in the middle of the screen, but since I had to zoom the page to be able to click the login button, when I zoom out, or move the screen, the dialog closes

I tested on Opera Mini, Firefox, Photon Browser and the default browser for Android. Not all bugs occurrs in all browsers.

I'm not saying that is a problem in the site, because on desktop I never had a problem. But it was not designed for mobile use.

And Dani, there's no way to do it behind the scenes that doesn't look like cross site requesting... Even if I keep an hidden browser, to keep session alive, and just fill the forms with the user input, in some way it'd still be a "bot" doing the work.

Maybe I'm missing something, but I think the only two options to do it without looking like forgery it'd be:
- Redirect to the login page (The idea that I first posted, but in that time I didn't thought that the authorization would require the login dialog, silly me)
- Login by API request (the API would have to support this with some kind of encryption)

AleMonteiro 238 Can I pick my title?

Dani, I would use an embed browser to make the login, but I tested the site in some androids browsers and it gets buggy sometimes, so for the end user this work will be really good.

The csrf_token is stored in the session? So I'd need to keep the session alive? Because I tried just passing one genereted csrf_token and I got the same message.

AleMonteiro 238 Can I pick my title?

Dani, thanks, I couldn't find this page on my onw.

About doing the login behind the scenes, I was analysing the html from daniweb and tried somethings...
One of them was to post Username, Password and Referer to the members/login page, hoping it will accept and redirect to the Confirm authorization page, but instead I got an "Ooops, error occurered", problems with session message.

Can you explain to me the validations behind the login so I can make the proper use of it?

PudingEatsPanda, I'm just starting this app, and I'm starting with the login/authorization part, because it's the one the I don't have complete knowlodge about. I think using the rest of the API will be much easier.
If you have any doubts that I can help with, I'll help gladly =)

AleMonteiro 238 Can I pick my title?

Dani, I'm gonna try make it behind the scenes, but I was testing the oAuth pages and confirmed the request, so it won't ask again for my login... there's any way to can the authorization so I can test it in my android app?

AleMonteiro 238 Can I pick my title?

You should use css reset as pixelsoul suggest.

Also, you should have a good understanding about css box model.

In those links you'll find the basics: http://www.w3schools.com/css/css_boxmodel.asp
http://css-tricks.com/the-css-box-model/

And here you'll have more info and somethings about compability: http://coding.smashingmagazine.com/2010/06/07/the-principles-of-cross-browser-css-coding/

AleMonteiro 238 Can I pick my title?

Oh, ok, so you'll have to use like this:

AND R.[Check-in time] BETWEEN DATEADD(hour, -R.Duration, '" & cboHour.Text & "' ) AND DateAdd(hour, -1, '" & cboHour.Text & "')
AleMonteiro 238 Can I pick my title?

cooling,

did you try using the last line as?

AND R.[Check-in time] BETWEEN DATEADD(hour, -R.Duration, '" & cboHour.Text & "' ) AND '" & (int.Parse(cboHour.Text) - 1) & "')

AleMonteiro 238 Can I pick my title?

Isn't this dynamic? Any propertie will be added...

You should only create a function to do it.

Or if you use jQuery use the $.extend() method: $.extend(obj1, obj2);

AleMonteiro 238 Can I pick my title?

By associative array you mean object?
Even if you recieve an associative array from PHP it'll be transformed into a object.

You can just loop one and insert in the other, like this:

var obj1 = {
    'banana': 'banana',
    'apple' : 'apple'
};

var obj2 = {
    'world': 'world',
    'earth': 'earth'
};

// Adds all properties in obj2 into obj1
// Any property that exists in obj1 and obj2 will be overwritten.
for(var prop in obj2) {
    obj1[prop] = obj2[prop];
}
AleMonteiro 238 Can I pick my title?

Hello Reliable,

JS is much more dynamic then AS 3, I used to work with AS3 with Flex, but I didn't miss a thing when I got back with JS.

There's multiple ways to define an JS function, some of them are:

// only functions
function myFunc() {};

var myFunc = function() {};

//function inside objects
var myObj = {
    prop: '',
    method: function() {

    }
};
myObj.method2 = function() {

};
myObj.method();
myObj.method2();

//Function prototype
var MyFunc = function() {}
MyFunc.prototype.Method = function() {};

var obj = new MyFunc();
obj.Method();

Also, there's multiple ways you can call a function in JS:

var func = function(param1, param2){
    // do something
};

func('a', 'b');

func.call(func, 'a', 'b');

func.apply(func, ['a', 'b']);

// you can even create a function with no name and execute it at the moment (used to control variable scopes)
( function(param1){
    // do something with param1
} ('value of param1'); )


// functions can also be passed as parameter, much used for callbacks
var func2 = function(callback) {
    callback('result of something');
}

func2(function(result) {
    alert(result);
});

// or you can pass the reference of the function
var func3 = function(result) {
    alert(result);
};

func2(func3);

Hope you can understand something inside this mess I wrote =D

AleMonteiro 238 Can I pick my title?

Dani, I'm planning what will be needed to acomplish this app, and my first doubt is about the login with OAuth2.

As described in the API page the app must redirect to the daniweb auth page, but the Android app will not run in a browser.

If this is the only way, I thought about the following, it's kind messy but I think it would work:

  1. Android app will embed an WebView which will load my auth page
  2. My auth page will redirect to Daniweb auth page
  3. Daniweb auth page will redirect back to my auth page
  4. My auth page will send the token to the Android App
  5. Android app will have the token to make the API requests

What do you think?

AleMonteiro 238 Can I pick my title?

What does dr.Item("dob").ToString returns?

If dr.Item("dob") is a valid date, this should work:

TempDate = new Date(dr.Item("dob").ToString("yyyy-MM-dd"))
txtDate.Text = TempDate.ToString("yyyy-MM-dd")
AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?

I'd like to make a pool to find out the most used Android OS version among Daniweb users, is there any way to do it in the forum? I couldn't find anything

AleMonteiro 238 Can I pick my title?

Try using like this:

TempDate = dr.Item("dob").ToString
txtDate.Text = TempDate.ToString("yyyy-MM-dd")
AleMonteiro 238 Can I pick my title?

I really never had problem with this, but I searched a little bit and this post may help you:

http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode

AleMonteiro 238 Can I pick my title?

If my logic is correct, just update this line:

AND R.[Check-in time] BETWEEN DATEADD(hour, -R.Duration, '" & cboHour.Text & "' ) AND '" & (int.Parse(cboHour.Text) - 1) & "')
AleMonteiro 238 Can I pick my title?

Anisha,

you could call your Handler.cs method inside the the MakeText() in Result.aspx.cs.

If you want Handler.cs to write your Result.aspx, you have to use one of the methods I suggest in my first post.

AleMonteiro 238 Can I pick my title?

Good to know Bill.

Just mark the thread as solved please.

Good weekwend too.

AleMonteiro 238 Can I pick my title?

Bill, it's all about CSS.

If you just want to bring the body content up, set margin-top: -10px;. Or decresce the first heading font-size.

AleMonteiro 238 Can I pick my title?

Oh, I didn't notice that... but your are making a lot of selects, so they can return in only one datatable.
You have to use an DataSet, like this:

SqlDataAdapter sda = new SqlDataAdapter(sc);
    DataSet ds = new DataSet();
    sda.Fill(dt);

And then use ds.Tables, for each select there'll be an table.

AleMonteiro 238 Can I pick my title?

Did you tried other browsers in your local env?

AleMonteiro 238 Can I pick my title?

I don't have one either, but at my firm we have one for testing apps. But I was uncertain because, who knows if in another country it could have another SO, like Windows Phome in example.

AleMonteiro 238 Can I pick my title?

Let me ask, in the actual scenario, if the user selects 13pm(and there's a reservation from 10 to 12) the facility is displayed?