Advanced Search

Page 5 of 8 FirstFirst ... 34567 ... LastLast
Results 41 to 50 of 72

Thread: Print not working as desired in Lightbox

  1. #41
    Join Date
    Feb 2013
    Posts
    49
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default

    Hi, What changes have you made in mootools-core.js (post # 28) - so my webpage working now as a browser independent webpage, please? Thank you.

  2. #42
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,672
    Thanks
    43
    Thanked 3,125 Times in 3,091 Posts
    Blog Entries
    12

    Default

    I see you're using the link. That's not the best idea because not everyone has an email client (required for an email link).

    But the main reason I'm responding is that I see that the forum converted some of my entities back to the actual characters and that I somehow left out the r in raihans (or the forum ate it) in both of my examples. I took care of all that by editing my above post. You should recopy whichever one you're currently using.

    As for database work, ask in the 'PHP' or probably better, the 'MySQL and other databases' forum here. I don't know very much about databases - yet.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #43
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,672
    Thanks
    43
    Thanked 3,125 Times in 3,091 Posts
    Blog Entries
    12

    Default

    Oh, and while I was typing that, I see you asked about MooTools. I added 2:

    Code:
    try{}catch(e){}
    blocks:

    Code:
    	append: function(original){
    		for (var i = 1, l = arguments.length; i < l; i++){
    			var extended = arguments[i] || {};
    			for (var key in extended) try{original[key] = extended[key];}catch(e){}//try/catch added for IE8 - jds
    		}
    		return original;
    	}
    for:

    Code:
    	append: function(original){
    		for (var i = 1, l = arguments.length; i < l; i++){
    			var extended = arguments[i] || {};
    			for (var key in extended) original[key] = extended[key];
    		}
    		return original;
    	}
    and:

    Code:
    	render: function(element, property, value, unit){
    		try{element.setStyle(property, this.serve(value, unit));}catch(e){}//add try/catch for IE 8 - jds
    	},
    for:

    Code:
    	render: function(element, property, value, unit){
    		element.setStyle(property, this.serve(value, unit));
    	},
    That's all from the uncompressed version. I then found the corresponding spots in the compressed version and changed them. All try{}catch(e){} does here is allow the browser to keep going if there's an error. Since (at least in this case) other browsers don't throw an error on those, and IE 8 works OK when it skips the errors it gets from those, it all works out fine.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #44
    Join Date
    Feb 2013
    Posts
    49
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default

    Thanks a lot for your reply.
    I have recently added chat option into my site (raihans.co.uk). I have used a third party chat component, named freichat, which is free to use. But in a corner it shows 'Powered by Codologic' - not seems very professional. I couldn't find any way remove it. Also could not move the 'chat room' tab anywhere else - for which, in some browser doesn't shows my slogan. Can you please, help me on this. Or if you know any other way to have chat options, please guide me.

    Thanking you again.
    Raihan

  5. #45
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,672
    Thanks
    43
    Thanked 3,125 Times in 3,091 Posts
    Blog Entries
    12

    Default

    That's what's known as "third party". A program that you add as an interface between you and your users. Many of these types of programs have service marks or copyrights like the 'Powered by' one you mention. Usually these are required as part of the usage terms of a free program. In these forums we are not allowed to help you avoid the usage terms of a third party program. Often it's also illegal to do so. It might not look professional. But free programs are often like that. It's called 'creditware'. Dynamic Drive scripts are like that, except that the credit only needs to be in the source code of the page. Iif you don't want the credit, often you can pay a fee to get the professional version, which usually has additional features, including the removal of the 'Powered by' credit. These additional features are often extensive though, giving you more control over how the program operates.

    If nothing like that is available for the chat program you're using, there are other chat programs. But since it's (chat programs) not something I'm very interested in, I'm not aware of the choices out there. Google:

    chat programs

    and you can probably find a lot of options.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following 2 Users Say Thank You to jscheuer1 For This Useful Post:

    letom (05-03-2013),raihan (03-19-2013)

  7. #46
    Join Date
    Feb 2013
    Posts
    49
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default

    Hi jscheuer1,
    Thanks a lot for your help in those days, came back to you again with a problem.
    Please log in to my site: raihans.co.uk with 'dbuser', 'passwd'. Then hover to 'User Log In/Out' and click on 'DB Test'.

    I wish to make just as the sample at the top. I have done the query and fetch in the first combo. The I have got the value in a variable as I clicked on a value in first combo, with a script. But I can't have the value in that variable to php again for another query. Can't find, how to do that, please help me. Here is what I did so far:

    Code:
    <script>
    function run() {
    var str = document.getElementById("Combo1").value;
    document.getElementById("text1").value = str;
    } 
    </script>
    
    <form name="testForm" id="testForm"  method="POST"  >
    
    <select name="Combo1" id="Combo1" onchange="run()">
    <option value="" selected>Select a country</option> 
    <?php $link = mysql_connect("Domain_Name","DB_User","DB_User_passwd");
    if (!$link)    {  die('Could not connect to Database: ' . mysql_error());   
    }
    mysql_select_db("DB_Name",$link);
    $category = "SELECT Country_Name FROM Test_Country";
    $query_result = mysql_query($category);
    while($result = mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['Country_Name']?>"><?php echo $result['Country_Name']?></option>
    <?php 
    } ?>
    </select>
    
    &nbsp;&nbsp;&nbsp; <select name="Combo2" id="Combo2">
    <option selected>Select a State</option>
    <?php
    $CName=$_GET['str'];
    $category = "SELECT State_Name FROM Test_State LEFT JOIN Test_Country USING (CountryID) WHERE Country_Name='$CName'";
    $query_result = mysql_query($category);
    while($result = mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['State_Name']?>"><?php echo $result['State_Name']?></option>
    <?php
    } ?>
    </select>
    
    &nbsp;&nbsp;&nbsp;TextBox1:&nbsp;&nbsp; <input type="text" id="text1" placeholder="get value on option select"><br>
    Thanking you again.


    Raihan
    Last edited by jscheuer1; 05-01-2013 at 12:47 PM. Reason: Format

  8. #47
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,672
    Thanks
    43
    Thanked 3,125 Times in 3,091 Posts
    Blog Entries
    12

    Default

    You would need to use AJAX. I see you have jQuery on the page, so something like:

    Code:
    <script>
    function run() {
    var str = document.getElementById("Combo1").value;
    document.getElementById("text1").value = str;
    (function($){
    	$.ajax({
    		url: getstates.php,
    		data: 'country=' + str,
    		method: 'post',
    		success: function(result){
    			$('#combo2').empty().append(result);
    		}
    	});
    })(jQuery);
    } 
    </script>
    Now, I'm not sure what to put on getstates.php, but it would be something like:

    PHP Code:
    <option selected>Select a State</option>
    <?php
    $CName
    =isset($_POST['country'])? $_POST['country'] : '';
    if(!
    $CName){die();}
    $category "SELECT State_Name FROM Test_State LEFT JOIN Test_Country USING (CountryID) WHERE Country_Name='$CName'";
    $query_result mysql_query($category);
    while(
    $result mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['State_Name']; ?>"><?php echo $result['State_Name']; ?></option>
    <?php
    }
    ?>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    raihan (05-02-2013)

  10. #48
    Join Date
    Feb 2013
    Posts
    49
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default

    Hi, Thanks a lot for your reply. Sorry, I don't know anything about ajax. But I have tried like below:

    <script>
    function run() {
    var str = document.getElementById("Combo1").value;
    document.getElementById("Text1").value = str;
    (function($){
    $.ajax({
    url: 'http://raihans.co.uk/source/Combo2Conct.php',
    data: 'country=' + str,
    method: 'post',
    success: function(result){
    $('#Combo2').empty().append(result);
    }
    });
    })(jQuery); }
    </script>

    <form name="testForm" id="testForm" method="POST" >

    <select name="Combo1" id="Combo1" onchange="run()">
    <option value="" selected>Select a country</option>

    <?php $link = mysql_connect("domain_name","DB_User","DB_User_pwd");
    if (!$link) { die('Could not connect to Database: ' . mysql_error());
    }
    mysql_select_db("DB_Name",$link);
    $category = "SELECT Country_Name FROM Test_Country";
    $query_result = mysql_query($category);
    while($result = mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['Country_Name']?>"><?php echo $result['Country_Name']?></option>
    <?php
    } ?>
    </select>

    &nbsp;&nbsp;&nbsp;TextBox1:&nbsp;&nbsp; <input type="text" id="Text1" placeholder="get value on option select"><br>
    </form>

    Then in my 'http:raihans.co.uk/source/Combo2Conct.php' file I have included:
    <option selected>Select a State</option>
    <?php
    $CName=isset($_POST['Country_Name'])? $_POST['Country_Name'] : '';
    if(!$CName){die();}
    $category = "SELECT State_Name FROM Test_State LEFT JOIN Test_Country USING (CountryID) WHERE Country_Name='$CName'";
    $query_result = mysql_query($category);
    while($result = mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['State_Name']; ?>"><?php echo $result['State_Name']; ?></option>
    <?php
    }
    ?>

    It's not working. Is there any chance to go step-by-step, as you did for me before. I am struggling with this for a long time. In the mean time I could also learn the basics of Ajax. Off-course, if you have enough time to allow me, please.

    Thanks a lot again.


    Raihan
    Last edited by raihan; 05-02-2013 at 06:40 PM.

  11. #49
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,672
    Thanks
    43
    Thanked 3,125 Times in 3,091 Posts
    Blog Entries
    12

    Default

    If you're going to look for:

    $_POST['Country_Name']
    on raihans.co.uk/source/Combo2Conct.php, then you need to send it from the AJAX call:

    Code:
    function run() {
     var str = document.getElementById("Combo1").value;
     document.getElementById("Text1").value = str;
     (function($){
     $.ajax({
     url: 'http://raihans.co.uk/source/Combo2Conct.php',
     data: 'Country_Name=' + str,
     method: 'post',
     success: function(result){
     $('#Combo2').empty().append(result);
     }
     });
     })(jQuery);
     }
    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

    One thing we have to make sure of though is that if you post a Country_Name to raihans.co.uk/source/Combo2Conct.php, does it output the states? I just tried with a simple form:

    HTML Code:
    <form method="post" action="http://raihans.co.uk/source/Combo2Conct.php">
    <input type="text" name="Country_Name">
    </form>
    Using spain as the country and all I got back was the initial option, the one hard coded on the raihans.co.uk/source/Combo2Conct.php page:

    HTML Code:
    <option selected>Select a State</option>
    That part is just basic PHP and database work. If the database isn't responding with the states, there's no amount of javascript code that's going to fix that.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  12. The Following User Says Thank You to jscheuer1 For This Useful Post:

    raihan (05-03-2013)

  13. #50
    Join Date
    Feb 2013
    Posts
    49
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default

    I did like:

    Code:
    <script>
    function run() {
    var str = document.getElementById("Combo1").value;
    document.getElementById("Text1").value = str;
    (function($){
        $.ajax({
            url: 'http://raihans.co.uk/source/Combo2Conct.php',
            data: 'Country_Name=' + str,
            method: 'post',
            success: function(result){
                $('#Combo2').empty().append(result);
            }
        });
    })(jQuery); }  
    
    </script>
    
    <form method="post" action="http://raihans.co.uk/source/Combo2Conct.php">
    <select name="Combo1" id="Combo1" onchange="run()">
    <option value="" selected>Select a country</option>
    <?php $link = mysql_connect("Domain_Name","DB_User","DB_User_pwd");
    if (!$link)    {  die('Could not connect to Database: ' . mysql_error());   
    }
    mysql_select_db("DB_Name",$link);
    $category = "SELECT Country_Name FROM Test_Country";
    $query_result = mysql_query($category);
    while($result = mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['Country_Name']?>"><?php echo $result['Country_Name']?></option>
    <?php
    } ?>
    </select>
    
    &nbsp;&nbsp;&nbsp;TextBox1:&nbsp;&nbsp; <input type="text" id="Text1" placeholder="get value on option select"><br>
    </form>
    and in my Combo2Conct.php:

    PHP Code:
    <select name="Combo2" id="Combo2">
    <option value="" selected>Select a State</option>
    <?php
    $CName
    =isset($_POST['Country_Name'])? $_POST['Country_Name'] : '';
    if(!
    $CName){die();}
    <?
    php $link mysql_connect("Domain_Name","DB_User","DB_User_pwd");
    if (!
    $link)    {  die('Could not connect to Database: ' mysql_error());   
    }
    mysql_select_db("DB_Name",$link);
    $category "SELECT State_Name FROM Test_State LEFT JOIN Test_Country USING (CountryID) WHERE Country_Name='$CName'";
    $query_result mysql_query($category);
    while(
    $result mysql_fetch_assoc($query_result)) { ?>
    <option value = "<?php echo $result['State_Name']; ?>"><?php echo $result['State_Name']; ?></option>
    <?php
    }
    ?>
    It's not working. I think it cannot access the 'Combo2Conct.php' file. Otherwise it should at least suppose to show the 2nd Combo, as at the beginning I have: <select name="Combo2" id="Combo2">. Don't know, why. Please reply me, what may be my fault here.

    I did tried with the name 'Spain', in seperate query and it's working. So I think the query portion is alright. Problems I believe somewhere in coding and file accessing. But, can't find.

    Thanks a lot again.


    Raihan
    Last edited by jscheuer1; 05-04-2013 at 01:35 AM. Reason: Format

Similar Threads

  1. how to move javascript to desired location on page?
    By rytis in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 07-20-2011, 05:25 PM
  2. print.css fot lightbox
    By lostnight in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 06-16-2009, 06:42 AM
  3. Lightbox Print Help
    By eld in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 04-23-2008, 07:22 PM
  4. Replies: 1
    Last Post: 12-09-2007, 11:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •