|
Which event is that? It occurs on page validation and ajax calls and a few other places. Where do i catch all of these events?
|
|
|
|
|
Sam Heller wrote: Which event is that?
Whatever you want it to be. You change the page. Well, you or code you control in some fashion. Once the document has loaded, it changes in response to code somewhere telling it to change... so whenever code does that, have it call your resize method.
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
Hi all,
A quick question
I have a select box and a button on a web page.
The user will choose a value in the select box then hit the button.
I need the chosen value to be stored in a php session variable and the user redirected to second webpage.
Any help would be fab !!!
Thanks lots
John
|
|
|
|
|
At Time of clicking on the button you have to submit the form then fetch value by
$storeValue = $_REQUEST['selectName'];
and then store the value in a variable and then
S_SESSION['sessionvariableName'] = $storeValue;
then open the another file you want to show.
--------------------------------------------------------------------------------------------------
Hiral Shah
India
If you think that my answer is good enough and can be helpful for other then don't forget to vote.
|
|
|
|
|
Here is what I would do:
<code><?php
session_start();
$options = array("Option1", "Option2", "Option3");
if ($_POST['submit']) {
if (in_array($_POST['option'], $options)) {
$_SESSION['selected'] = $_POST['option'];
header("Location: secoundpage.php");
exit();
}else {
$error = "That was an incorrect selection";
}
}
?></code>
<html>
<head>
<title>Welcome</title>
</head>
<body>
<form action="" enctype="multipart/form-data" method="post">
<code><?php echo $error; ?></code><br />
<select name="option">
<code><?php
foreach ($options as $value)
{
$sel = '';
if ($value == $_POST['option']) {
$sel = "selected=\"selected\" ";
}
echo "<option {$sel}value=\"{$value}\">{$value}</option>\n";
}
?></code>
</select>
<br />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
Brad
Australian
- Me on "Public interest"
If you actually read this let me know.
|
|
|
|
|
Hi, hope someone is able to help me.
I want to cause the client's browser to expand to full screen mode (like hitting the F11 key) when the user load my webpage. I was thinking of using javascript function which will be called when the page body loads eg. Anyone can provide a sample code for the exec_function()? Thanks in advance.
|
|
|
|
|
That is impossible.
You can resize the browser window to fit the screen, but even that is not guaranteed to work, as most browsers can be set up to disallow this.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have seen this done with Java.
Brad
Australian
- bryce on "Problems with Code Project"
*sigh* Maunder's been coding again...
|
|
|
|
|
If it can't be done in JS, how about asp.net or C# ? Are there commands that I could use, in some way, to cause the browser to go full screen ?
|
|
|
|
|
The only way I can think of would be to set Kiosk mode on a shortcut, but I've always had problems with setting a URL and Kiosk mode at the same time...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
|
Hi, I have a photography website and am trying to set up a shop for it, but I have no knowledge of web programming, I have found a shop that uses java script (I don't want anything more advance)
The shop has a list of items that have a checkbox next to them, when you click the checkbox its adds up the total cost of the order in a box at the bottom, but being a photography site I need the checkboxes to be drop down lists so the customer can select the size of print that they want. I don't know how to make each list option have a cost attached to it. Below is the source code for the shop, if anyone can understand what I am talking about and is willing to help I would be very greatfull.
<script language="JavaScript">
var Cost, Grand_Total;
function tally()
{
Cost = 0;
if (document.orderform.Item1.checked) { Cost = Cost + 26.15; }
if (document.orderform.Item2.checked) { Cost = Cost + 26.10; }
if (document.orderform.Item3.checked) { Cost = Cost + 26; }
document.orderform.Total.value = "£" + Cost;
}
function pound (amount)
{
amount = parseInt(amount * 100);
amount = parseFloat(amount/100);
if (((amount) == Math.floor(amount)) && ((amount - Math.floor (amount)) == 0))
{
amount = amount + ".00"
return amount;
}
if ( ((amount * 10) - Math.floor(amount * 10)) == 0)
{
amount = amount + "0";
return amount;
}
if ( ((amount * 100) - Math.floor(amount * 100)) == 0)
{
amount = amount;
return amount;
}
return amount;
}
</script>
<form method="post" name="orderform" action="mailto:me@mydomain.com" enctype="text/plain"">
<table border="0">
<tr>
<td colspan="2"><p>
<input type="checkbox" name="Item1" value="Item1_chosen" onclick="tally()" />
Item One (£26.15) </p>
<p>
<input type="checkbox" name="Item2" value="Item2_chosen" onclick="tally()" />
Item Two (£26.10) </p>
<p>
<input type="checkbox" name="Item3" value="Item3_chosen" onclick="tally()" />
Item Three (£26) </p>
<p>
<label>
<select name="prints">
<option>Option</option>
<option value="Print1">Print 1</option>
<option value="Print2">Print 2</option>
<option value="Print3">Print 3</option>
</select>
</label>
</p>
<p> </p></td>
</tr>
<tr>
<td> Total</td>
<td><input type="text" name="Total" value="£0" size="7" /></td>
</tr>
<tr>
<td>Contact Name:</td>
<td><input name="Name" type="Text" id="Name" size="20" /></td>
</tr>
<tr>
<td>Address</td>
<td><input type="Text" name="Street" size="20" maxlength="40" /></td>
</tr>
<tr>
<td>City</td>
<td><input type="Text" name="City" size="20" maxlength="20" /></td>
</tr>
<tr>
<td>Post Code</td>
<td><input type="text" name="Code" size="9" maxlength="10" /></td>
</tr>
<tr>
<td>Email Address</td>
<td><p>
<input type="Text" name="Email" size="30" maxlength="30" />
</p> </td>
</tr>
<tr>
<td colspan="2" height="3"><hr /></td>
</tr>
<tr>
<td colspan="2" align="center"><input name="Submit" type="Submit" value="Send Order" />
Or
<input name="RESET" type="reset" value="Reset Order" /></td>
</tr>
</table>
</form>
|
|
|
|
|
Do not try write your own shop if you do not understand how to develop. Monetary functions need to be handled with the greatest of care.
Brad
Australian
- Bradml on "The ADOTD"
Hey all, did you just use/read an acronym? Pots it HERE, at the ADOTD[^]
|
|
|
|
|
You should never do anything in javascript that isn't double checked on the server side. And, like Brad said, you probably should pay someone to do this, rather that try to learn web development over a weekend. Especially where money is involved.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to know how i can integrate a J2EE app with microsoft Sharepoint.
Vikram Verma
|
|
|
|
|
|
Can anyone Please let me know the way of integrating J2EE with Microsoft Share point???? Iam are doing it for one of our vendors??Any help is greatly appreciated....
|
|
|
|
|
Well when it comes to ISAPI I am totaly lost, I dont know how it works how to implement it , all I know it is great for SEO (Search engine optimization).
All pageurl's work like
www.mysite.com/default.aspx?pageId=1
And it should look like
ww.mysite.com/Page1/index.html
Can someone help me or point me to a good tutorial.
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
I have found the solution but coming back here because I hate leaving a thread without a answer.
I have found a article
http://msdn2.microsoft.com/en-us/library/ms972974.aspx[^]
this explains multiple ways of rewriting your url's to search engine friendly versions, it is 18 pages long but every bit worth going through
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Hi guys I don't know if anyone can help me but I have a piece of javascript that gets the window dimensions and places the content in the middle, but when I run my app in firefox it doesnt even seem to execute the javascript.
<script language="JavaScript" type="text/jscript" >
<!--
function setHeight(){
document.getElementById("bodyContent").style.visibility = "hidden";
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
//window.alert( 'Width = ' + myWidth ); //Show When Debugging
//window.alert( 'Height = ' + myHeight ); //Show When Debugging
//Set Height of Table
document.getElementById("placeholderTable").style.height=(myHeight-50)+"px";
document.getElementById("RadMenu1").style.height = 2+"px"
document.getElementById("RadMenu1").style.height = 28+"px"
document.getElementById("bodyContent").style.visibility = "visible";
document.getElementById("bodyContent").style.display = "block";
alert("hello");
}
-->
<!-- ============================= -->
</script>
This is executed on my body's onload() event.
Please help!
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Open the error console in Firefox so that you see what error message you get when you open the page.
---
single minded; short sighted; long gone;
|
|
|
|
|
Would it not maybe be simpler to do this using CSS markup?
|
|
|
|
|
Dont worry about this one , all I did was change the <script> tag to
<SCRIPT LANGUAGE="JAVASCRIPT"> and it seemed to work.
thanx
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
I see. Now I noticed that you used the type "text/jscript" in the script tag. JScript is the Microsoft variation of Javascript, and only exists in Internet Explorer. Use this tag instead:
<script type="text/javascript">
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanx,
I was just being lazy, its strange how sometimes we dont care how it works until it doesnt work at all.
I am a bit new to creating software that is multibrowser compatible, but slowly and surely I am getting there, I will add that tip to my notebook.
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|