Fungus1487 55 Posting Pro in Training

You want to use the following...

var session = <%=Session["username"] != null ? "true" : "false"%>;

Now for as to why you would want to do this is beyond me? If you can check this when the page is being processed on the server you can simply force a redirect like the following...

if(Session["username"] == null) {
    Response.Redirect("login.aspx", true);
}

But i'm assuming this is also not what your after. If you want to check the users session is valid repeatedly e.g every 30 seconds then neither of those methods will work.

The reason being is that once the server has sent the page to the user the session check is calculated and hard-coded into the JavaScript. It will NOT be re-assessed everytime you call the javascript method as it is static.

To perform this you will need two steps, the first is to setup a page to return a flag indicating whether a users session is valid and secondly perform an asynchronous request to fetch the users session state.

First of all create a page e.g. SessionCheck.aspx and add the following...

{"valid":<%=Session["username"] != null ? "true" : "false" %>}

Secondly add the following script to your existing page...

function checkSession() {
    var request = false;

    if(window.XMLHttpRequest) { // Mozilla/Safari
        request = new XMLHttpRequest();
    } else if(window.ActiveXObject) { // IE
        request = new ActiveXObject("Microsoft.XMLHTTP");
    }
    request.open('POST', 'SessionCheck.aspx', true);
    request.onreadystatechange = function() {
        if(request.readyState == 4) {
            var session = eval('(' + request.responseText + …
Fungus1487 55 Posting Pro in Training

Try using the new HTML5 attribute placeholder, this will only work in modern browsers.

<input type="text" name="myinput" placeholder="enter something" />
Fungus1487 55 Posting Pro in Training

I believe so, I just wonder if there are any circumstances where Microsoft Word will not create the ~$ prefixed system file.

Fungus1487 55 Posting Pro in Training

Well could you not perform the following...

Dim workbook As String = "C:\MyWorkBook.xls"
Dim isOpen As Boolean

' The method should try to open your workbook, if failure then return true
isOpen = CheckIsWorkbookOpen()

While isOpen
  Interaction.GetObject(workbook).close(False)

  ' Force garbage collection
  GC.Collect()

  ' Check if workbook can be opened again
  isOpen = CheckIsWorkbookOpen()
End While

' Eurika! The loop has completed, the workbook must be closed

This way you keep closing any remaining instances that are open until you hit the jackpot.

And to be honest if the guy wanted to give his management team advice he probably wouldn't have posted to the VB.Net DaniWeb forum.

Fungus1487 55 Posting Pro in Training

You will need to check the exact instance name under the processes tab in task manager, it will be something like EXCEL.exe

As with your posted code there is no way to cast from a Process to an Application instance. The Workbook is a wrapper around the api calls required to talk to excel whilst the Process is just a pointer that an Application is in memory.

I'm afraid I have had little success finding any way to connect to an already open instance of Excel.

You may be able to use Interaction.GetObject to return instances of excel that are open but I'm afraid it looks as though it is quite random to which instance you will return.

Fungus1487 55 Posting Pro in Training

Nope. A process is just a pointer. Same as your processes tab in task manager.

There may be a way using the process Id to connect to live instances of excel. Ill take a quick look.

Fungus1487 55 Posting Pro in Training

A simpler approach would be to iterate through all the comboboxes on your form (or control that holds combo boxes e.g. a Panel), build up a collection of these comboboxes then compare them accordingly. The following code contains two methods, AreSelectedComboBoxValuesDuplicated and GetComboBoxes.

GetComboBoxes does exactly what it says on the tin and gets a controls child combobox controls, it is recursive so it will check within the controls child controls and within their controls etc.

Once we have this list of combo boxes we can then check to see if any contain the same value. AreSelectedComboBoxValuesDuplicated simply loops through all combo boxes we have found and compares each found combobox against all the others, the search IS case sensitive. The method will then return a flag indicating whether any values were duplicated or not.

Private Function AreSelectedComboBoxValuesDuplicated(parent As Control) As Boolean
        ' Get all combo boxes
	Dim comboBoxes As IList(Of ComboBox) = GetComboBoxes(parent)
	For i As Int32 = 0 To comboBoxes.Count - 1
                ' Get current combobox
		Dim comboBox As ComboBox = comboBoxes(i)
		For k As Int32 = 0 To comboBoxes.Count - 1
			If k <> i Then
                                ' If the combobox to compare to is not the same one then check value
				If [String].Compare(comboBox.Text, comboBoxes(k).Text, False) = 0 Then
					Return True
				End If
			End If
		Next
	Next
	Return False
End Function

Private Function GetComboBoxes(parent As Control) As IList(Of ComboBox)
	Dim comboBoxes As IList(Of ComboBox) = New List(Of ComboBox)()
	For Each child As Control In parent.Controls …
Fungus1487 55 Posting Pro in Training

Just out of curiosity why would you want to do this?

You can change your theme programmatically by changing the registry values found at...

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes

Fungus1487 55 Posting Pro in Training

Im not sure you will be able to check if excel has a specific file open but you could easily close all Excel instances from your application with something along the lines of.

Dim instances() As Process = Process.GetProcessesByName("EXCEL.EXE")
For Each instance As System.Diagnostics.Process In instances
	instance.Kill()
Next

Note that this will close ALL instances of excel that are open.
You could always prompt the user to make sure they want to do this before hand as well as first check if you can open the file and only close all excel instances if opening fails.

Fungus1487 55 Posting Pro in Training

No problem, if your all sorted you can mark the thread as solved.

Fungus1487 55 Posting Pro in Training

1. Don't use ID like you do. ID's are meant to be unique but your first section use "qa1" and "qa2" twice in both anchors and is then used in the divs as part of the second section.

2. You dont need the "OnClick" attribute if using jQuery (it is not recommended practice)

3. The easiest way would be to change your anchors id to different attributes (perhaps your own) or seeing as you are using the id in the href attribute use that instead e.g.

<div id="mainq" style="padding:10px;" class="mainq"><a name="top"></a>
    <h3>Payment and Billing.</h3><br />
    <a href="#aq1">What is water?</a><br />
    <a href="#aq2">What is copper?</a><br />
    <h3>Payment and Billing.</h3><br />
    <a href="#aq1">What is water?</a><br />
    <a href="#aq2">What is copper?</a><br />
</div>

And then change your JavaScript to read...

<script type="text/javascript">
    $(function() {
        $('#mainq a').click(function() {
            var id = $(this).attr('href');
            $(id).highlightFade({speed:2000});
        });
    });
</script>

With the above code you then seperate the actual javascript from the page view. I have changed your id variable to get the href attribute which would be '#qa1' or '#qa2' and then it finds this element using another jQuery selector $(id).

Hope this helps

Fungus1487 55 Posting Pro in Training

You will need to randomly generate numbers and check that they have not already been displayed. The below does this by continuosly looping until it has found the total range of values. Each loop generates a new number then checks if it exists in the array. If not the new value is appended and output to the screen.

var arrayContains = function(array, value) {
    for(var i in array) {
        if(array[i] == value) { return true; }
    }
    return false;
};

var found = [];
var range = 4; // 0 - 4
while(found.length < range) {
    var num = Math.floor(Math.random() * (range + 1));
    // If it is new then add it and print it
    if(!arrayContains(found, num)) {
        found[found.length] = num;
        document.writeln(num);
    }
}
Fungus1487 55 Posting Pro in Training

javascript is especially useful serverside, where ASP.NET is absolutely weak... ;) from this point on you can guess my answer. Or maybe we wouldn't need servers in the future...

Are you saying that javascript is useful serverside? Or is it intended to be sarcastic, i hope so!

I agree with sedgey about the hosting but any dynamically data driven site; daniweb, msdn, facebook, google etc. could not be entirely JavaScript this is a useless comparison as they require server side code be it ASP.Net, ASP, PHP etc. to perform some heavy lifting of data to output content to a page.

Fungus1487 55 Posting Pro in Training

you cant directly as they are two seperate languages. you could output content to the page using a script block somthign like the following

string g = "ZOMGGGG";
bool s = g.contains("GGGG");
Response.Write("<script type=\"text/javascript\">alert('" + s + "');</script>");
Fungus1487 55 Posting Pro in Training

marjaan_m

at first glance it looks like your this line is wrong
give the full path and then try
e.g if you are at localhost then

http://localhost/xyz/functions/travellerdetail.php

obj_t.open("GET","functions/travellerdetail.php?tid="+id,true);

it does not require a full URL but give it a try anyway.

Does the page POST BACK?
This might happen cuz you have not specified '#' in the href property of the anchor tag

Fungus1487 55 Posting Pro in Training

so does it still do this with my example ?

Fungus1487 55 Posting Pro in Training

First of all if the document is (X)Html then your link tag needs to be closed.

<link rel="stylesheet" type="text/css" href="stylesheet/style.css">

should be

<link rel="stylesheet" type="text/css" href="stylesheet/style.css" />

Secondly the script tag REQUIRES you to specify its type.

<script>

should be

<script type="text/javascript">

You also need a closing </body> and </html> tag at the end of the document. Ive taken your script and reformatted it, try the following.

<?
	include "functions/mysql.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Find Travellers</title>
    <link rel="stylesheet" type="text/css" href="stylesheet/style.css" />
    <script language="javascript" type="text/javascript">
        function createXmlHttpRequest() {
            var x;
            try {
                x = new XMLHttpRequest();
            } catch(ex) {
                try {
                    x = new ActiveXObject("Msxml2.XMLHTTP");
                } catch(ex2) {
                    try {
                        x = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch(ex3) {
                        x = false;
                    }
                }
            }
            if(x) { return x; } else { return false; }
        }

        function showdetail(tid) {
            var xmlHttp = createXmlHttpRequest();
            if(xmlHttp) {
                xmlHttp.onreadystatechange = function() {
                    if(xmlHttp.readyState === 4) {
                        var data = xmlHttp.responseText;
                        var dv = document.getElementById('tdetail');
                        dv.innerHTML = data;
                    }
                };
                xmlHttp.open('GET', 'functions/travellerdetail.php?tid=' + id, true);
                xmlHttp.send(null);
            }
            return false;
        }
    </script>
  </head>
  <body>
    <table>
      <tr>
        <td>
          <?$Q = mysql_query("select * from travellers where t_type = 'air'");?>
          <div id="byair">
            <?
              while($R = mysql_fetch_array($Q)) {
            ?>
            <br />
            <a href="#" class="tlink" onclick="return showdetail(<? echo $R["t_id"]; ?>)" id="<? echo $R["t_id"]; ?>" name="<? echo $R["t_name"]; ?>"><? echo $R["t_name"]; ?></a>
          <? } ?>
        </div>
      </td>
    </tr>
    <tr>
       <td> 
         <div id="tdetail"></div>
        </td>
      </tr>
    </table>
  </body>
</html>
Fungus1487 55 Posting Pro in Training

seems fine but a tip is dont use document.writeln.
try having a content area in the page e.g. a "<div>" then give this element and ID and set its innerHTML property to the text you want.

document.getElementById('someelement').innerHTML += 'your text';
Fungus1487 55 Posting Pro in Training

you have alerted the 'obj_t.responseText' value and it definately is returning text ? Also do you have an element in the page with ID 'tdetail'. If so can you post your pages HTML as there may be a problem elsewhere

Fungus1487 55 Posting Pro in Training

This should be in the JavaScript forum but from looking at your code quickly it seems ok but you need to make sure the browser your using supports creating your XMLHttpRequest object like you do. The following code is taken from a project of mine which I know works feel free to try it out and see if its working in place of your code.

var createXmlHttpRequest = function() {
    var x;
    try {
        x = new XMLHttpRequest();
    } catch(ex) {
        try {
            x = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(ex2) {
            try {
                x = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(ex3) {
                x = false;
            }
        }
    }
    if(x) { return x; } else { return false; }
};
	
var createUniqueUrl = function(url) {
    return url + (url.indexOf('?') !== -1 ? '' : '?') + '&$=' + new Date().getTime();
};

var ajax = function(url, id) {
    var xmlHttp = createXmlHttpRequest();
    if(xmlHttp) {
        xmlHttp.onreadystatechange = function() {
            if(xmlHttp.readyState === 4) {
                var data = xmlHttp.responseText;
            }
        };
        url = createUniqueUrl(url + '?id=' + id);
        xmlHttp.open('GET', url, true);
        xmlHttp.send(null);
    }
};
Fungus1487 55 Posting Pro in Training

or use the built in method

session_destroy();
PinoyDev commented: useful +1
Fungus1487 55 Posting Pro in Training
function validateRBL(RBLid)
{
   ...
    if ( isItemChecked == false ) {
        var answer = confirm ("Please confirm selection...")
        if (answer) {
            wasOkPressed = true; /* You forgot to set the global flag */
            return true;
        } else {
            return false;
        }
    }
    ...
}

You forgot to set the global 'wasOkPressed' flag after someone has selected Ok in the confirm dialog, this is how it knows whether to keep on validating. good luck.

Fungus1487 55 Posting Pro in Training

Following code should set you on the right path.

var wasOkPressed = false;

// Create an array of your checked controls
var controlArray = [ '<%= T_selector.ClientID %>', '<%= P_selector.ClientID %>', '<%= Q_selector.ClientID %>', '<%= R_selector.ClientID %>' ];

function validate() {
    wasOkPressed = false;

    // Loop through each control
    for(var i = 0; i < controlArray.length; i ++) {
        if (!wasOkPressed ) { // If ok was not pressed keep validating
            if (!validateRBL(controlArray[i])) {
                // If control fails to validate return false
                return false;
            }
        }
    }
    return true;
}
Fungus1487 55 Posting Pro in Training

easiest way to do this is with javascript and all your content in page.
Example:

with a simple HTML layout like below with your seperate "pages" content in each 'div'.

<div id="content01" class="show">
    <p>Content 01</p>
    <p>My first bit of content to show everybody</p>
</div>

<div id="content02" class="hide">
    <p>Content 02</p>
    <p>Another bit of content to show everybody</p>
</div>

<div id="content03" class="hide">
    <p>Content 03</p>
    <p>Again!!! Another bit of content to show everybody</p>
</div>

And the following CSS, you will have a page with the other content in it but only one block is visible.

div.show
{
    display:block;
}
div.hide
{
    display:none;
}

You then use javascript to change which is visible

function changeContent(contentID) {
    // Hide the 3 holders first
    document.getElementById('content01').classname = 'hide';
    document.getElementById('content02').classname = 'hide';
    document.getElementById('content03').classname = 'hide';

    // Then show the content whose ID was passed to this function
    document.getElementById(contentID).classname = 'show';
    return false;
}

Then in you menu down the side of the page you would add a javascript "onclick" event to each of the buttons so they would show different blocks

<p><a href="#" onclick="return changeContent('content01');">Show Content Block 01</a></p>
<p><a href="#" onclick="return changeContent('content02');">Show Content Block 02</a></p>
<p><a href="#" onclick="return changeContent('content03');">Show Content Block 03</a></p>

This is definately not the best method but i am assuming you dont have too much previous experience with javascript. There are free API's out there which can do alot of this for you and also use XMLHttpRequests to 'dynamically' load pages such as jQuery. I recommend you check it …

Fungus1487 55 Posting Pro in Training

i dont quite understand what you mean by "Basically I need to validate only once, if the user click OK then I don't want the js continue validate additional controls even if it is '&&'." so this could be wrong but.

in your "validate" function if you check the first method then set a global flag if the user chooses ok you can check before hitting the second validation.

var wasOkPressed = false;
function validate() {
    wasOkPressed = false;
    var firstResult = validateRBL('<%= T_selector.ClientID %>');
    return wasOkPressed ? true : firstResult && validateRBL('<%= P_selector.ClientID %>');
}
Fungus1487 55 Posting Pro in Training
<asp:RadioButtonList ID="T_selector" runat="server">

The ID you give the ASP control will change at runtime.

if (document.getElementById("T_selector").checked==false)

You need to change your hardcoded ID string to change at runtime using.

(document.getElementById('<%= T_selector.ClientID %>').checked==false)

or you can use the following if you have the Microsoft Ajax Library in your project.

($get ('T_selector').checked==false)

The id's you set for ASP controls are changed at runtime due to the server side compilation. This may seem confusing but for instance if you have a page which contains 2 user controls which both contain a textbox with id 'textName' then the document could not be well formed due to two ID's colliding, also the server would not be able to distinguish between the two on postback.

Hope this helps.

Fungus1487 55 Posting Pro in Training

Normally when you do this in C# you would have done something like this to open a new Form. Is the solution something simular to this ?

Form2 form2 = new Form2();
form2.Show();

Im just curious as to when you would do this on a web page ?

What your looking to do is

Response.Redirect = "http://www.google.com/";

having not used visual web developer i am unsure how you would go about it, but you would not want to post back to achieve this when it can be done in standard HTML unless you needed to perform some validation.

If these are ASP controls which i assume they are, a property is available to you which you can set on each of the buttons along the lines of 'PostBackURL'

Fungus1487 55 Posting Pro in Training

Hey frnds, I m able to acess the admin tools. My website name is sonia.
I open admin tools & right click on folder sonia but hi fungus there is no custom menu "Convert To Application" . U can see it in the attachment.....

The days of IIS 5.1, beautiful. Im guessing here but have you looked under all tasks sub context menu ? Not having XP or IIS 5.1 anymore (Since 2006) i really cannot remember exactly where this is found although you dont seem to have ASP.NET installed as you should have an "aspnet_client" folder under the "Default Website"

You need to go to the add ASP.NET as a sub component of the IIS in add/remove programs on the control panel.

Fungus1487 55 Posting Pro in Training

other than majestics reason i cant think of any why you cannot gain access to administrative tools

Fungus1487 55 Posting Pro in Training

Hi frnd,there is no Administrative Tools option in Control Panel..Can u plz confirm me out...

what operating system and setup are you using ?

Fungus1487 55 Posting Pro in Training

i have to disagree here, why is it bad to hand code aspx pages? just wondering as there are many programmers/developers that program in the most basic of all programs "notepad" for HTML, CSS, Javascript, php, Java and many other languages

Using an IDE simply makes it faster to develop but doesnt at all make the process of learning the language any easier.

further to this im sorry i didnt answer your question.

If you did build this site in visual studio or an IDE then using the RUN command will run your website. I understand if you wish to set this up manually though you will need to tamper with your IIS.

You have created your directory below "wwwroot" so all you need to do is open "Control Panel >> Administrative Tools >> Internet Information Services [version no.]" then in the tree on the left navigate to the "Default Website". Expand this node and you will see your folder "Website1", right click and choose "Convert To Application", now run your url and if everthing is setup fine it will work.

If you receieve an error stating the server does not know how to handle the file type "aspx" you will need to open "Control Panel >> All Programs" then press "Add Remove Windows Features", you will need to navigate to "Internet Information Services >> World Wide Web Services" and then make sure the following are checked.
> .NET Extensibility
> ASP.NET
> ISAPI …

Fungus1487 55 Posting Pro in Training

you are missing your form tag, also it is not good idea to hand code aspx pages. try visual web developer/

i have to disagree here, why is it bad to hand code aspx pages? just wondering as there are many programmers/developers that program in the most basic of all programs "notepad" for HTML, CSS, Javascript, php, Java and many other languages

Using an IDE simply makes it faster to develop but doesnt at all make the process of learning the language any easier.

Fungus1487 55 Posting Pro in Training

css works by nesting. so...

ul li

"li" is found below "ul"

li li

"li" is found below "li"

Example

<div>
  <ul>
    <li>
      <ul>
        <li>Text 01</li>
      </ul>
    </li>
    <li>Text 02</li>
  </ul>
</div>
ul li {
  color:#aaaaaa;
}

ul ul li {
  color:#ff3333;
}

The style for "ul li" will set all "li" elements found under a "ul" element to the color "#aaaaaa" in the example above this means all text will be of the color "#aaaaaa".

The second style for "ul ul li" will set all "li" elements found under a "ul" which is found under a "ul" to the color "#ff3333". Only the text "Text 01" will be of this color as it is the only "li" element that has been nested within two "ul" tags.

Hope this helps clarify.

daviddoria commented: Great answer. +1
buddylee17 commented: looks like you solved this one +3
Fungus1487 55 Posting Pro in Training

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180')"
href="javascript:;"

Try

onclick="window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');return false;"
href="javascript:void(0);"

And if that fails you could always try

onclick="var w = window.open('popup.aspx?textbox=txtDate','cal','width=250,height=225,left=270,top=180');w.focus();return false;"
href="javascript:void(0);"
Fungus1487 55 Posting Pro in Training

Theres two ways to fix this. The following adds a div to push the outer box down below the floated element.

<div class="row" id="rowTxt">
<div class="left"><label for="enq">Enquiry <br /><span class="small"> Please enter a general enquiry</span></label></div>
<div class="right"><textarea name="enq" id="enq" rows="5" cols="40"></textarea><br /><span class="err" id="enqErr">Invalid Entry</span></div>
<div style="display:block;width:100%;" />
</div>

Or

You can set a height to your row in your CSS like so...

#rowTxt {
    height:80px;
}

Using this second method it would be better to assign a "height" style to the text area so you could manage the height of the row with the text area. Else the first method will allow the height of the textarea to be dynamic allowing for crossbrowser differences in the "rows" html attribute.

Fungus1487 55 Posting Pro in Training

this will only work in IE at best.

If thats not a problem then we need to see your "B.aspx" page to see what is going wrong.

If cross browser issue is a problem try looking into the "ajaxControlToolkit" available here. It contains a managed way of creating in page modal dialogs.

Fungus1487 55 Posting Pro in Training

it would be something like the line-height property of the left hand labels adding a sort of padding to your element. So the actual height of this element is larger than your inputs but not the height of the textarea. When your error messages come to render themselves they all have the left hand labels extra height to push them across the screen.

A better solution would be.

<div class="holder">
    <div class="left">
        ... label and other elements
    </div>
    <div class="right">
        ... text area and other elements
    </div>
</div>
.holder
    {
        display:block;
    }

    .holder .left
    {
        float:left;
        width:300px;
    }

    .holder .right
    {
        margin-left:300px;
        width:auto;
    }
Fungus1487 55 Posting Pro in Training

First of all to stop your input/textareas from bouncing everytime you focus them do this.

input,textarea {
    height: 1.5em;
    width:  15em;
    padding: 0;
    [B]margin: 1px 1px 1px 1px;[/B]
    border: 1px solid gray; 
    font: 11px "Lucida Sans Unicode", Verdana, Arial; 
    color: #666;
}
input:focus, textarea:focus{
    border-width: 2px;
    border-color:    #d5dae7;
    [B]margin:0px[/B]
}

The problem you are having with the text not aligning itself to the textarea is that the span element has no element to force it into the position you require.

Add the following to your code. 310px is the sum of your label width (290px) + label left margin (10px) + label right margin (10px).

[B]#enqErr {
	margin-left:310px;
}[/B]

Hope this helps.

Fungus1487 55 Posting Pro in Training
Name: <%= Page.Request("nameField") %> <br />
Age: <%= Page.Request("ageField") %> <br />
Comment: <%= Page.Request("commentField") %> <br />
Fungus1487 55 Posting Pro in Training

You need to force the browser to refresh it looks like. Im afraid the easiest method is to change its name. maybe you could add a time to the end of the file i.e. "filename_20080607.jpg" etc.

Jihad commented: good suggestion +1
Fungus1487 55 Posting Pro in Training

<center> element is depreciated in html and not supported in xhtml but it would not cause IE to not render an image.

try changing your image names to a.jpg and b.jpg to see if it can find them then

the only other thing could be have you converted your images correctly. I had a dodgy batch of Jpegs from a client once which would not show in a browser.

if this is still causing a problem after try opening the image in your favourite editor (ms paint if you have to) then do a "file" >> "save as" and make sure "jpg" is selected in the dropdown.

Fungus1487 55 Posting Pro in Training

echo the $query variable before it is fired to see exactly what the query is at runtime.

Fungus1487 55 Posting Pro in Training

is the function in the <head></head> area of the html document. the online example i put up works fine in both IE and firefox and the code has just been dragged from that.

Fungus1487 55 Posting Pro in Training

yes that may just work. but the increased time in doing this loop may take just as long as your original solution.

Fungus1487 55 Posting Pro in Training

i chopped up your code and used it with some big pics of my band.

here is the result resize example

my connection is fast but it seems to be resizing the image after it is loaded then moving on. But you would have to add an

onload="resizeImage(this)"

to every image tag you want resizing compared to your looping method. Personally i think the iterative loop at the end is a much better approach but this way works too.

var maxwidth = 100;
var maxheight = 100;
function resizeImage(img) {
	if(img.getAttribute("alt")=="user posted image") {
		w=parseInt(img.width);
		h=parseInt(img.height);
		if (parseInt(img.width)>maxwidth) {
			img.style.cursor="pointer";
			img.setAttribute('title','Reduced Image - Click to see full size');
			img.onclick=new
			Function('onclick=jkpopimage(this.src,600,500);');
			img.height=(maxwidth/img.width)*img.height;
			img.width=maxwidth;
		}
		if (parseInt(img.height)>maxheight) {
			img.style.cursor="pointer";
			img.onclick=new
			Function('onclick=jkpopimage(this.src,600,500);');
			img.width=(maxheight/img.height)*img.width;
			img.height=maxheight;
		}
	}
}
<p><img src="img.jpg" alt="user posted image" onload="resizeImage(this)" /></p>
Fungus1487 55 Posting Pro in Training

your welcome feel free to give me some rep :D and mark the post as solved

Fungus1487 55 Posting Pro in Training

why not use the "defer" attribute of the script tag?

<script type='text/javascript' [B]defer='defer'[/B]>

you could also add an onLoad event handler to run the script once the browser has loaded all information. But defer should work fine for what your after.

Fungus1487 55 Posting Pro in Training
<p class="MsoNormal">
<span style="font-size: 10.0pt; font-family: Verdana">
Florida PROMiSE partners and staff can use the following site to share and exchange information regarding to the project.&nbsp; &nbsp;</span></p>
<p class="MsoNormal" align="left">
<font size="2"><span style="font-family: Verdana">
<a [B]target="_blank"[/B] href="http://coursesites.blackboard.com/webapps/portal/frameset.jsp">
Florida PROMiSE Secured Project Site</a></span></font></p>
Fungus1487 55 Posting Pro in Training

then you would search using the following in that circumstance.

SELECT * FROM S WHERE s1 LIKE '%what you want to search for%'

The % sign either side of the search text indicates two wildcards and will search for the string inside other strings.

E.G.

table 'user' has rows...

id | name
1  | 'john'
2  | 'alan'
3  | 'joe'

when firing this SQL statement

SELECT id FROM user WHERE name LIKE '%jo%'

it will return rows with ID's 1& 3

because john and joe contains the phrase 'jo'

if you wanted to do this through all your tables and they have a similiar format.

then you could use a php array to hold the table name, ID and search field and loop through generating the sql statement dynamically.

Fungus1487 55 Posting Pro in Training

SELECT * FROM tablename WHERE somefield LIKE '%searchquery%'

other than taking the time to write an iterative script you will need to write individual SQL statements for each table.