AleMonteiro 238 Can I pick my title?

Violet, your code won't work cause you can't use $(function(){}) inside an function.

$(function(){}) is a shortchut to window.onload event, so if you put it inside another function it won't be executed.

Also, the param you recieve in the changeImage function is a string, so you would need to get the element by that id.

To your function to work it should be something like this:

function change_image(image)
{
    $(".overlay").show();
    $(".box").show("slow");
    $("#" + image).fadeIn(4000);
    $(".close_button").show();
 
    $(".close_button").click(function() {
        $(this).hide();
        $("#" + image).fadeOut("fast"); // You need to close the opened image now
        $(".box").hide("slow");
        $(".overlay").hide("slow");
    });
});
}

But let me explain my code, i've ajusted to your new html with hidden full image:

// Set on document ready/window onload event
		$(function() {
			// Set click listener on <a>
			$("a.full_image").click(function() {
				
				// $(this) is the <a> element clicked
				var $imgThumb = $(this).children("img"); // Get the <img> element inside the <a>
				var $imgFull = $(this).next("img"); // Get the next <img> element besides <a>
				
				var urlThumb = $imgThumb.attr("src"); // Get the src attribute from the thumb <img>
				var urlFull = $imgFull.attr("src"); // Get the src attribute from the full <img>
				
				$(".overlay").show();
				$(".box").show("slow");
				$(".standalone_image").css("background", "url('" + urlFull + "')") .fadeIn(4000);
				$(".close_button").show();			
			});
			
			$(".close_button").click(function() {
				$(this).hide();
				$("standalone_image").fadeOut("fast");
				$(".box").hide("slow");
				$(".overlay").hide("slow");
			});
		});
AleMonteiro 238 Can I pick my title?

Taywin, I didn't know that. Why?

AleMonteiro 238 Can I pick my title?

You should only create the elements by JS when needed. You can create the table in pure html and then just add the dynamic rows.

Something like this:

<html>
    <head>
        <title>Future Value Calculation</title>
        <style type = "text/css">
            table { width: 100% }
            th    { text-align : left } 
			th span { color: #008; margin-left: 15px; }
        </style>
        <script type = "text/javascript">
        // Start the script once the page has loaded
		window.onload = function()
		{
			var EndBal;
			var principal = 2000.00;
			var rate = 0.12;
			
			for ( var age = 28; age <= 65; ++age )
			{
				// Do calculations
				EndBal = principal * Math.pow(1.0 + rate, age );
				// Insert row
				var row = getById("tBody").insertRow(0); //Insert row at index 0
				// Create cells for the created row
				// Empty cells are set to &nbsp to be displayed in the table
				row.insertCell(0).innerHTML = age; 
				row.insertCell(1).innerHTML = EndBal.toFixed(2);
				row.insertCell(2).innerHTML = "&nbsp;";
				row.insertCell(3).innerHTML = "&nbsp;";
				row.insertCell(4).innerHTML = "&nbsp;";
			}
			
			// Set the header values
			getById("spnInitial").innerHTML = principal.toFixed(2);
			getById("spnRate").innerHTML = rate.toFixed(2);
			getById("spnDeposit").innerHTML = "...";
			getById("spnInvestment").innerHTML = "...";
        }
		
		// Helper function to get element by id
		function getById(id)
		{
			return document.getElementById(id);
		}
        </script>
	</head>

<body>
	<table border="1">
		<thead>
			<tr><th colspan="5">Future Value Calculation</th></tr>
			<tr><th colspan="5">Initial Investment:<span id="spnInitial"></span></th></tr>
			<tr><th colspan="5">Interest Rate:<span id="spnRate"></span></th></tr>
			<tr><th colspan="5">Deposit every 30 days:<span id="spnDeposit"></span></th></tr>
			<tr><th colspan="5">Investment started:<span id="spnInvestment"></span></th></tr>
			<tr>
				<th>Age</th>
				<th>Beg Bal</th>
				<th>Interest</th>
				<th>Deposits</th>
				<th>Ending Bal</th>
			</tr>
		</thead>
		<tbody id="tBody">
		
		</tbody>
	</table>
</body>

</html>

Hope it helps.

AleMonteiro 238 Can I pick my title?

To get the text box is very simple, you can use the class selector to match all text boxes with that class:

<script>
    $(".contentbox").keyup(function()
    {
        ...
    });
</script>

<input type="text" class="contentbox" />

For each dynamically created text box you will have an count box? If so you'll have to change your code to get the nearest count box from the current typing text box.

AleMonteiro 238 Can I pick my title?

Violet 82, you are right about the url. In this way the url of the full image will be the same of the thumb.

To overcome that you need to store the full image url in somewhere. There a lot of ways you can do it: Store in some non-using attribute, create some new attribute like bigImageSrc(in XHTML), use an input hidden, javascript array, jquery.data and etc.

I made an example with alt non-using attribute and input hidden.

<script>
		$(function() {
		
			$("a.full_image").click(function() {
				var $img = $(this).children("img");
				var urlImg = $img.attr("src"); // thumbnail src
				urlImg = $img.attr("alt"); // big src from alt attr
				urlImg = $(this).children("input").val(); // big image from input hidden 
				
				$(".overlay").show();
				$(".box").show("slow");
				$(".standalone_image").css("background-image", "url(" + urlImg + ")") .fadeIn(4000); // works
				$(".standalone_image").css("background", "url('" + urlImg + "')") .fadeIn(4000); // works as well
				$(".close_button").show();			
			});
			
			$(".close_button").click(function() {
				$(this).hide();
				$("standalone_image").fadeOut("fast");
				$(".box").hide("slow");
				$(".overlay").hide("slow");
			});
		});
	
	</script>
	

	<body>

         <div class="overlay" id="overlay" ></div>
         
         <div class="box" id="box">
         	
			<div class="standalone_image"></div>
           	  
             <div class="close_button" id="close_button"></div>
               	
         </div>

		<div class="thumb_container">                
			<div class="thumbnail">  
				<a href="#" class="full_image">
					<img src="images/water_thumb_1.jpg" alt="images/water_thumb_1_big.jpg" style="border:0">
					<input type="hidden" value="images/water_thumb_1_big.jpg" />
				</a>
			</div>
		
			<div class="thumbnail">    
				<a href="#" class="full_image">
					<img src="images/water_thumb_2.jpg" alt="images/water_thumb_2_big.jpg" style="border:0">               
					<input type="hidden" value="images/water_thumb_1_big.jpg" />
				</a>
			</div>
		</div>
	</body>
AleMonteiro 238 Can I pick my title?

Let's see the problems:

1. You don't have to use an <a href="#">, you can set the click directly on the image.

2. You have to got the url of the thumbnail clicked and then set it on the stand alone image.

3. Use the css property cursor: pointer.

Your JQuery could be something like this:

<script type="text/javascript">

		$(function() {
			$("img.full_image").click(function() {
                                var urlImg = $(this).attr("src");
				$(".overlay").show();
				$(".box").show("slow");
				$(".standalone_image").css("backgroundimg", "url('" + urlImg + "')") .fadeIn(4000);
				$(".close_button").show();			
			});
			
			$(".close_button").click(function() {
				$(this).hide();
				$("standalone_image").fadeOut("fast");
				$(".box").hide("slow");
				$(".overlay").hide("slow");
			});
			
		});

		</script>

and the thumb html:

<div class="thumbnail">  
     <img  class="full_image" src="images/water_thumb_1.jpg" alt="" style="border:0">
</div>
AleMonteiro 238 Can I pick my title?

From inf.php you want to be able to access the ft.php fields?

AleMonteiro 238 Can I pick my title?

Please post your JS code.

AleMonteiro 238 Can I pick my title?

I didn't understood much of what you said. But PHP cannot hold a JS var, PHP can only execute JS by writing it and JS can only execute PHP by a server request.

Is something like this you want?

<?php
    echo('<script type="text/string">window.open(....);</script>');
?>
AleMonteiro 238 Can I pick my title?

AJAX is pretty simple my friend and with JQuery you can do it with just one hand =)

The code that i wrote you will do the AJAX request passing the image data to the PHP page, and the result of the request will be alerted.

You just have to import jquery on your page =)

AleMonteiro 238 Can I pick my title?

I'd suggest that you first create the HTML and CSS of the image displayer(the 3 layers your friend told you about).

When the look is the way you want, you hide it(display: none; for example) and then start playing with JS e JQuery to open the displayer and set the image that should be displayed.

I'd also use JS to center vertically the image displayer on the browser.

Good luck.

AleMonteiro 238 Can I pick my title?

Javascript can't connect direct with the database.

You have to send the data to the PHP page that will handle it.

You can use JQuery to do it cleanly with AJAX.

// Send a post request to PHP_PAGE.PHP with the image data
$.post("PHP_PAGE.PHP", { image: myImageVar }, 
    function(response) // handle the return of the AJAX request. response is the data that the page printed
    {
        alert(response);
    }
);

Hope it helps.

AleMonteiro 238 Can I pick my title?

When you use the keyboard to select the options and then send the form, witch value does it have?

If you alert the value of a select, using keyboard to select it, what happens? It's undefined or a wrong value?

AleMonteiro 238 Can I pick my title?

Use location.search to get the query from the url.

Like this:

$(function(){
     var path = location.pathname.substring(1);
     if ( location.search )
          path += location.search;
     if ( path )
          $('#nav ul#navigation li a[href$="' + path + '"]').attr('class', 'selected');
});

Hope it helps.

AleMonteiro 238 Can I pick my title?

The best way to validate e-mail address is with regular expression.

Here's the one I use:

// returns true or false
function isEmail(str)
{
	var regExp = /\b([\w-\.]+\@([\w-]+\.)+[\da-zA-Z]{2,4})\b/;
	regExp.test(str);
}

Hope it helps.

AleMonteiro 238 Can I pick my title?

Open IE -> Tools -> Internet Options -> Security Tab -> Custom Level -> Active X and plugins

Set it up as you wish =)

AleMonteiro 238 Can I pick my title?

It's quite simple with JQuery.

The boring part is to make the css.

Check this simple example:

<html>

	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
	
	<script>
		//document ready
		$(function()
		{
			$(".item").hover(function()
			{
				$(this).css("z-index", 999); // Set item to be on top of everybody else
				$(this).children(".label").slideUp(); // Hide label on mouse over
				$(this).children(".description").slideDown(); // Show description on mouse over
			},
			function()
			{
				$(this).css("z-index", 10); // Restore z-index
				$(this).children(".label").slideDown(); // Show label on mouse out
				$(this).children(".description").slideUp(); // Hide description on mouse out
			});
		});
	
	</script>
	
	<style text="text/css">
		.item
		{
			width: 200px;
			height: 200px;
			position: relative;
		}
		
		.item .image
		{
			position: absolute; top: 0; left: 0;
			z-index: 10;
		}
		
		.item .label
		{
			position: absolute; bottom: 0; left: 0;
			width: 200px;
			height: 30px;
			background: #800;
			color: #fff;
			z-index: 20;
		}
		
		.item .description
		{
			position: absolute; top: 0; right: -200px;
			width: 200px;
			height: 200px;
			background: #008;
			color: #fff;
			display: none;
			z-index: 30;
		}
	</style>
	
	<body>
	
		
		<div id="itens">
			<span class="item">
				<img class="image" src="http://cjsmedium.web.officelive.com/images/pink-floyd-backs-5000178.jpg" width="200" height="200" />
				<span class="label">label here</span>
				<span class="description">
					hdusauhd suahdhusa uhuhdsa uhdusahd huashud ashudu hauhdu hashud huauhd huashud aushduh auhduhasuh daushuhd auhsuhd auhduhasudhasuh
				</span>
			</span>
			<span class="item">
				<img class="image" src="http://i871.photobucket.com/albums/ab278/CrimsonBlade7/Dark_Side_of_the_Moon_by_megamanexe.png" width="200" height="200" />
				<span class="label">label here</span>
				<span class="description">
					hdusauhd suahdhusa uhuhdsa uhdusahd huashud ashudu hauhdu hashud huauhd huashud aushduh auhduhasuh daushuhd auhsuhd auhduhasudhasuh
				</span>
			</span>
			<span class="item">
				<img class="image" src="http://www.wallpaperbase.com/wallpapers/music/pinkfloyd/pink_floyd_8.jpg" width="200" height="200" />
				<span class="label">label here</span>
				<span class="description">
					hdusauhd suahdhusa uhuhdsa uhdusahd huashud ashudu hauhdu hashud huauhd huashud aushduh auhduhasuh daushuhd auhsuhd auhduhasudhasuh
				</span>
			</span>
			<span …
AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?

I'm not familiar with the validate plugin. But, maybe, instead of using onkeyup="document.myform.submit();" you can use something like this:

$(function()
	{
		$(document).keyup(function(evt)
		{
			if ( evt.keyCode == 13 ) // Enter
			{
				$("#myForm").validate();
			}
		});
	});

Hope it helps.

AleMonteiro 238 Can I pick my title?

You are welcome. :D

Please, mark the thread as solved.

Seeya.

AleMonteiro 238 Can I pick my title?

It would be something like this?

<html>
<head>
<script language="javascript">
	
	window.onload = function()
	{
		var divImages = getById('images');
		for(var i=0; i < divImages.children.length; i++)
		{
			divImages.children[i].onclick = function()
			{
				getById('images-list').innerHTML += '<img src="' + this.src + '" width="100" height="100" />';
			}
		}
	}
	
	function getById(id)
	{
		return document.getElementById(id);
	}
	
</script>
  
</head>
 
<body>
  
	<div id="images">
		<img src="http://cjsmedium.web.officelive.com/images/pink-floyd-backs-5000178.jpg" width="200" height="200" />
		<img src="http://i871.photobucket.com/albums/ab278/CrimsonBlade7/Dark_Side_of_the_Moon_by_megamanexe.png" width="200" height="200" />
		<img src="http://www.wallpaperbase.com/wallpapers/music/pinkfloyd/pink_floyd_8.jpg" width="200" height="200" />
		<img src="http://www.progarchives.com/progressive_rock_discography_covers/364/cover_20612192009.jpg" width="200" height="200" />
	</div>
	
	<hr />
	
	<div id="images-list">
	
	</div>
	
</body>
</html>

An observation: it'll only work after all images are loaded.

Hope it helps.

AleMonteiro 238 Can I pick my title?

IE needs to be configured to accept ActiveXObjects in the advanced properties. If the browser is set to not accept it, you'll receive "Access Denied" error.

AleMonteiro 238 Can I pick my title?

Is it throwing an any errors?

AleMonteiro 238 Can I pick my title?

You are welcome.

The key feature for your issue is not javascript, but how to execute an PHP function directly from a URL.

You need something like this: url/file/function?params

If you are able to do it, then it's just a matter of posting to the URl via AJAX.

I don't know if it's possible cause i don't have much experience with PHP. But i know that asp.net has an structure called ServiceModel that allow you to do this, so i guess it might be one for PHP too.

In asp.net ServiceModel you can do something like this:

function executeServerFunction()
{
    MyNameSpace.MyClass.MyFunction(params..., sucessCallBackFunction, errorCallBackFunction);
}

Good luck.

AleMonteiro 238 Can I pick my title?

What do you mean? Your code is working ok. I mean, it's adding text inputs and buttons, and the button reset works fine too.

AleMonteiro 238 Can I pick my title?

I don't think you can do it directly. You would have to use some PHP MVC framework.
Natively PHP is executed by a file request, not an method request.

AleMonteiro 238 Can I pick my title?

Hi,

you have to loop the existing rows and see if the values matches.

And one advice, don't use ////////// in comments. Instead use //------ or /******/.

Here is the loop code:

//------------------------------------------
			// here is my code to change quantity
			//------------------------------------------
			if ( tab.rows.length > 2 )
			{
				for(var i=1; i < tab.rows.length-1; i++) 
				{
					// Create var to minimize the code
					var cells = tab.rows[i].cells;
					
					if ( cells.length > 1 )
					{
						// Get current row values
						var rowName = cells[1].children[0].value.toLowerCase();
						var rowQnt = parseFloat(cells[2].children[0].value);
						var rowPrice = parseFloat(cells[3].children[0].value);
						
						// Only group if name and price are the same
						if ( name.value.toLowerCase() == rowName && priceVal == rowPrice )
						{
							cells[2].children[0].value = qtyVal + rowQnt;
							
							calcValue(cells[2].children[0], cells[3].children[0], cells[4].children[0]);
							return;
						}
					}
				}
			}

Here is the full code:

<html>
<head>
<script language="javascript">
// JavaScript Document
	function updateSum(formID, nameID, quantityID, priceID) {
		var f = document.getElementById(formID)
		var name = document.getElementById(nameID)
		var quantity = document.getElementById(quantityID)
		var price = document.getElementById(priceID)
 
		if (f && name && quantity && price) {
			var tab = f.getElementsByTagName("table")[0];  // expect a table	

			var qtyVal = parseFloat(quantity.value)
			var priceVal = parseFloat(price.value)
			if (!qtyVal) { qtyVal = 0 }
			if (!priceVal) { priceVal = 0 }
	
			//------------------------------------------
			// here is my code to change quantity
			//------------------------------------------
			if ( tab.rows.length > 2 )
			{
				for(var i=1; i < tab.rows.length-1; i++) 
				{
					// Create var to minimize the code
					var cells = tab.rows[i].cells;
					
					if ( cells.length > 1 )
					{
						// Get current row values …
AleMonteiro 238 Can I pick my title?

So, there you go.

You don't have a JS problem anymore, it's just not working because the ajax doesn't return what is should.

You got to resolve your PHP and MySQL problem, maybe it's missing some include in this page.

AleMonteiro 238 Can I pick my title?

Like this:

window.onload = function()
{
    var jumpMenu = document.getElementById("jumpMenu");
    jumpMenu.onchange = function()
    {
        var val = jumpMenu.options[jumpMenu.selectedIndex].value;
        if ( val != "#" ) 
        {
            window.location = 'http://www.mysitehere.com/subfolder/subfolder1/subfolder3/' + val;
        }
    }


}
AleMonteiro 238 Can I pick my title?

alert the req.responseText and see what's coming

AleMonteiro 238 Can I pick my title?

And how do you calculate the @dayend?

AleMonteiro 238 Can I pick my title?

There's no risk in this case. When you publish your project it'll be compiled and the source code won't be visible to the end user.

What someone could do is try to crack your application, but even then, they would not see your code but just the assembly generated by it.

What you must do is define the circumstances that the data will be shown and make sure that it's not possible for the user to "hack" those circumstances inside the app. I mean, you have to be careful in the spot you set the variables that will make the app show the data.

It would be risky with those variables were set from a form for example.

AleMonteiro 238 Can I pick my title?

I don't get it. Do you have one textbox for @start and one for @dayend?
@Dayend is a number or a date?

AleMonteiro 238 Can I pick my title?

You are using Windows Forms or ASP.NET?

In asp.net there is the Session object. That you can use like this:

Session["myVar"] = 10;
int myVar = (int)Session["myVar"];

If you are using windows forms and don't know if there is anything like that. But you could use static variables to do it.

AleMonteiro 238 Can I pick my title?

I've add somethings to your code to make it work like you would like it to.

To update the total and grand total after changing the value you need to listen to the input change event, so you know when to recalculate it.

<html>
<head>
<script type="text/javascript">

	function updateSum(formID, nameID, quantityID, priceID) {
		var f = document.getElementById(formID)
		var name = document.getElementById(nameID)
		var quantity = document.getElementById(quantityID)
		var price = document.getElementById(priceID)

		if (f && name && quantity && price) {
			var tab = f.getElementsByTagName("table")[0]  // expect a table
			var row = tab.insertRow(tab.rows.length - 1)

			var qtyVal = parseFloat(quantity.value)
			var priceVal = parseFloat(price.value)
			if (!qtyVal) { qtyVal = 0 }
			if (!priceVal) { priceVal = 0 }
			qtyVal = parseInt(Math.round(qtyVal*100),10)/100      // force 2 decimal
			priceVal = parseInt(Math.round(priceVal*100),10)/100  // force 2 decimal
			var total = qtyVal * priceVal
			total = parseInt(Math.round(total*100),10)/100      // force 2 decimal


			var noCell = row.insertCell(0)
			var txtNo = document.createElement('input');
			var id = tab.rows.length - 2
			txtNo.type = 'text';
			txtNo.style.textAlign = "right"
			txtNo.size = 1;
			txtNo.disabled = "disabled"
			txtNo.value = tab.rows.length - 2
			noCell.appendChild(txtNo);

			var nameCell = row.insertCell(1)
			var txtName = document.createElement('input');
			txtName.type = 'text';
			txtName.name = "name" + id;
			txtName.style.textAlign = "left"
			txtName.disabled = "disabled"
			txtName.size = 50;
			txtName.value = name.value
			nameCell.appendChild(txtName);

			var quanityCell = row.insertCell(2)
			var txtQuanity = document.createElement('input');
			txtQuanity.type = 'text';
			txtQuanity.name = "quantity" + id;
			txtQuanity.id = "quantity" + id;
			txtQuanity.style.textAlign = "right"
			txtQuanity.size = 10;
			txtQuanity.value = qtyVal
			quanityCell.appendChild(txtQuanity);

			var priceCell = row.insertCell(3)
			var txtPrice = document.createElement('input');
			txtPrice.type = 'text';
			txtPrice.name = "price" + …
AleMonteiro 238 Can I pick my title?

Because the tutorial PHP page returns the entire select and not only it's options.

This works:

myDiv.innerHTML = '<select><option value=1>Option One</option></select>'

But this does not work:

mySelect.innerHTML = '<option value=1>Option One</option>'

The tutorial is using the first one, but your code is trying the second.

AleMonteiro 238 Can I pick my title?

Post your code that get the value

AleMonteiro 238 Can I pick my title?

To avoid conflict, use "JQuery." insted of "$."

AleMonteiro 238 Can I pick my title?

In a <select> you must use the onChange event to do this kind of stuff. Because click event will be fired before the user select some option.

AleMonteiro 238 Can I pick my title?

I didn't understood what you want.

AleMonteiro 238 Can I pick my title?

Hi there, create the text inputs are very easy.

Check out this example:

<html>
	<script type="text/javascript">
		
		window.onload = function()
		{
			var select = document.getElementById("select");
			var texts = document.getElementById("texts");
			select.onchange = function()
			{
				var val = select.options[select.selectedIndex].value;
				texts.innerHTML = "";
				for(i=0; i < val; i++)
				{
					texts.innerHTML += '<div><input type="text" name="t_' + i + '" value="select_' + i + '" /></div>';
				}
			}
		}
		
	</script>
	
	<body>
		<select id="select" size="1">
			<option value="1">1</option>
			<option value="2">2</option>
			<option value="3">3</option>
			<option value="4">4</option>
			<option value="5">5</option>
		</select>
		
		<hr/>
		
		<div id="texts"></div>
		
	</body>
</html>

It's working, just run it.

Hope it helps.
Seeya.

AleMonteiro 238 Can I pick my title?

Use JQuery my friend.

They have the best selectors.

//To set the innerHTML of <li class="item31">
// # is the ID select
// . is the class selector

$('.item31').html('My new HTML');

JQuery it's a very useful JS lib, learn it and it'll save u time =)

Seeya.

AleMonteiro 238 Can I pick my title?

And what's the problem?

You can't get the textarea object or you can't just get it's value?

AleMonteiro 238 Can I pick my title?

Checking browser it's not a good solution cause you'd be leaving some unknow browser behind.

It's best just to check if what you need is supported by the browser.

Checkout this post: http://www.quirksmode.org/js/support.html

If you still wants to check out the browser, you can use either JQuery or Browser Detect

Hope it helps.
Seeya.

AleMonteiro 238 Can I pick my title?

You are alerting "req.value", witch doesen't exists. And you cannot set a <select> innerHTML, you must add options to it.

The PHP page should return just the data, without the HTML. You could do it with XML, JSON or with your own syntax.

If you in the future need to use more data then just the value and the text, i recommed that you use JSON.

Just for the select you can pass the data like this: value|data||value|data
Here an example

<html>
	<script type="text/javascript">
		
	var strData = '1|Option One||2|Option Two';

	function parseData(data)
	{
		var select = document.getElementById("select");
		var arrData = data.split("||");
	   
		for(var i=0; i < arrData.length; i++)
		{
			var arrValues = arrData[i].split("|");
			select.options[i] = new Option(arrValues[1], arrValues[0]);
		}
	}
	
	window.onload = function()
	{
		parseData(strData);
	}
	</script>
	
	<body>
		<select id="select" size="1"></select>
	</body>
</html>
AleMonteiro 238 Can I pick my title?

First debug it, use FireBug on FF or Dev tools on IE.

If it doesn't show any errors, try and put some alerts to see where the code is entering.

AleMonteiro 238 Can I pick my title?

It's possible if both page and iframe have the same domain.

You could do something like this, using JQuery:

<html>

	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
	
	<script>
		//document ready
		$(function()
		{
			//inserts iframe
			$('<iframe src="page_test.htm" />').appendTo("body");
			
			//add load handler to iframe
			$("iframe").load(function()
			{
				//Get all links<a>, unbind the event onClick and set a new one
				$(this).contents().find("a").attr("onClick", "").click(function()
				{
					alert($(this).html());
				});
			});
		});
	
	</script>
	
	<body></body>
	
</html>

The iframe page is:

<html>	
		<script type="text/javascript">
			function openUrl(url)
			{
				alert(url);
				window.location = url;
			}
		</script>
	
	<body>
		<a href="JavaScript: void(0);" onClick="JavaScript: openUrl('page_test.htm');"> Click Me One</a> <br/>
		<a href="JavaScript: void(0);" onClick="JavaScript: openUrl('page_test.htm');"> Click Me Two</a> <br/>
		<a href="JavaScript: void(0);" onClick="JavaScript: openUrl('page_test.htm');"> Click Me Three</a> <br/>
	</body>
	
</html>

If your iframe is from other domain you wouldn't have access to do it, because browser security.

AleMonteiro 238 Can I pick my title?

Hi, two things:

first your code has an error, the correct is:

success: function() {
      $('#freekk').html("<div id='message' style='color: #4f4f4f; font-size: 12px; display: inline;'></div>")
      .fadeIn(1500, function() {
        $('#message').append("ClassMate request sent!");
      });
    }

second, change the attribute type from submit to button, like this:

<input type=button value='Add ClassMate' class='nrbutton submitbuttonsend' style='width: 150px;'>

Hope it helps.

AleMonteiro 238 Can I pick my title?

Actually i'm doing something like that right now. But i'm not doing web site code generator, i'm doing an form and reports code generator.

I definitely think it pays off. But it's not so simple as it look like.

If you have good templates, with well organized source code, it shouldn't be so painful :D

An advice that i can give to you about it, do take a good time to plan your database, it'll save you a lot of time in the future, and a lot of headache as well.

AleMonteiro 238 Can I pick my title?

Hi there,

i've always used JSON.NET in my projects, and for me it was very successful and easy to use.

The site has some good example too, and you can find a lot more on the web by searching it.

Link: JSON.NET

Hope it helps.