|
Can anyone please shed some light on what is happening here.
I am in the process of developing a web site which contains a calendar that my viewers can select a date and when clicking on that date another window opens to display a day planner with times throughout the day.
They would then click on a day to open yet another page to book their appointment with me.
The issue is this: I have used the window.open function in the following way,
to create button,
the onclick function is: ="DayPlan=window.open('', 'DayPlan', 'width=300, height=300'); which was supposed to open the window and name="s1" value=" 1 "> ... ...
note: the bold type is the actual code I have used!
This script repeats for each of the days in the month.
When I run it and click on a day I get a message that says there is an error...and tells me that 'access is denied.'
Can anyone please, please shed some light on what is happening. I have only just started using javascript so I am in need of simple explanations. Sorry for being a pain.
A Good Instructor Will Lead You Where You Are Too Afraid To Go Alone
|
|
|
|
|
I may be misunderstanding your code, but isn't the window.open() meant to open a URL? It looks to me like you are missing a URL.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
Hi Boro...thanks for the reply. Yes it can open a URL but if left blank will open a blank window, according to a listing to test the window.open() i got from a teaching book. Like I said I am very new to this and have got most of my information/knowledge from 'SAMS Teach Yourself JavaScript' over the last few days.
A Good Instructor Will Lead You Where You Are Too Afraid To Go Alone
|
|
|
|
|
Can you show the actual code that you are using?
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa
The original code I got from http://javascriptkit.com/script/script2/buttoncalendar.shtml
I then added this function:
function OpenDayView()
{
DayPlan=window.open('', 'DayPlan', 'width=300, height=300');
}
//OpenDayView()
And modified this one:
function setDate(str) {
if (str == " ") {
alert('Sorry, you selected an invalid date!');
return;
}
else {
OpenDayView()
}
This should work like this;
user clicks blank button and gets 'selected invalid date' message...
user clicks valid date and gets new blank window opened.
I get error message...'access is denied'
your thoughts would be very much appreciated.
Paul
A Good Instructor Will Lead You Where You Are Too Afraid To Go Alone
|
|
|
|
|
That looks like it should work.
There is a possibility that there is a popup blocker stopping the window, of course. You don't get any indication of that?
How are you calling the function?
---
b { font-weight: normal; }
|
|
|
|
|
hi all,
i'm creating a site using php and a mysql database. i have a query that will look something like INSERT INTO table (value1, value2) VALUES ('...', '...') . the table 'table ' has an auto-increment int 'id ' field. how can i get the id of the row i just inserted, without SELECT ing the row using WHERE value1='...' AND value2='...' ?
thanks in advance.
-- modified at 10:10 Sunday 20th August, 2006
|
|
|
|
|
Use the query "select last_insert_id()" on the same connection that you used to insert the record, and you get the id.
---
b { font-weight: normal; }
|
|
|
|
|
i just did a search on "last_insert_id" and found this:
http://us3.php.net/manual/en/function.mysql-insert-id.php
thanks for the reply!
|
|
|
|
|
Hello all,
I'm attempting to create an ASP.NET master page that has a three column layout and doesn't use tables.
Right now, I have two images, BGLeft.png and BGRight.png that will be used for the backgrounds of the right and left columns. I've set BGLeft to be the background of the body of the page. I then added a div for a wrapper and set its margin to 100px, which is the width of BGLeft.png. The wrapper div has BGRight.png as its background. The background is aligned to the right.
The layout is perfect now, except one little thing. I want the wrapper div to have the same height as the body (so that the right and left background images are the same height). How do I make this happen? Should I use some javascript or is there a better (CSS) way of doing this?
Thanks,
Will Gant
|
|
|
|
|
Try setting 'height:100%' in the style of your wrapper div.
If that doesn't help, here is a link to great page of css layout templates, which I find very useful. http://www.intensivstation.ch/en/templates/[^]
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
using HTML can I set a left and right border to a cell or column in a table w/o setting a top and bottom border? I don't want a box around it. I want a vertical line to the left and right of it.
|
|
|
|
|
Yes, using CSS.
Give your table an id for example id="MyTable"
Then in your style sheet create a style for the columns in that table
#MyTable td{
border-right:1px solid #CCC;
border-left:1px solid #CCC;
border-top ;
border-left ;
}
You can replace the #CCC with which ever colour you want, and set the width of the border. You can also try 'dotted' or 'dashed' instead of 'solid'.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
|
Hi all,
I have created a DHTML Behavior that changes the style of buttons on my web page. I apply the behavior to the buttons using the class attribute, and the behavior is embedded in my style in a css file.
Now, it all works great, currently I have this functionality:
* change the gradient filter direction from up to down on mouseover
* change gradient filter direction from down to up on mouseout and mouseup
* change the gradient filter direction to left to right on mousedown
additionally it changes the borders and padding to give a click effect.
Now I want to extend this a little.
How can I have a gradient wipe included on the mousedown event so as it is clicked it appears to wipe from one side to the other but how can I do this please? Do I need to have the filter already part of the button element (INPUT Type = Button !) when it is loaded?
Here is the code as it stands in the event handler for mousedown in my htc file:
function MouseDown()
{
runtimeStyle.padding = "0px 4px 4px 4px";
runtimeStyle.color = "white";
runtimeStyle.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#ffffff, EndColorStr=#ababab)";
runtimeStyle.borderRightStyle = "solid";
runtimeStyle.borderRightWidth = "1px";
runtimeStyle.borderRightColor = "#7b9ebd";
runtimeStyle.borderTopStyle = "ridge";
runtimeStyle.borderTopWidth = "1px";
runtimeStyle.borderTopColor = "#7b9ebd";
runtimeStyle.borderLeftStyle = "ridge";
runtimeStyle.borderLeftWidth = "1px";
runtimeStyle.borderLeftColor = "#7b9ebd";
runtimeStyle.borderBottomStyle = "ridge";
runtimeStyle.borderBottomWidth = "1px";
runtimeStyle.borderBottomColor = "#7b9ebd";
}
thanks for any help or advice
Philip
|
|
|
|
|
|
Using Javascript and CSS.
Hy Chanhan
|
|
|
|
|
BUT I SAVE THE PIC,PIC IS REALY ADD FRAME?
|
|
|
|
|
Stop screaming.
What are you meaning? What picture? What is it that the picture is?
---
b { font-weight: normal; }
|
|
|
|
|
I have 3 ASP.NET drop down lists:
Day/Month/Year
And i was wondering if i can use Javascript the add and remove dates from the day drop down list without posting back based on what month or if it was a leap year etc ?
Not sure if this post is in the right place as its both ASP.NET and Javascript... sory if its misposted.
Thanks.
|
|
|
|
|
Strictly speaking, you can not change the DropDownList using Javascript, as that control only exist on the server.
The DropDownList is rendered as a select list in the html code, and you can change the items in that element using Javascript.
The element has an attribute named options, that you can use to add, remove or change the items.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I have create one website, there address bar show query string values
(~/sample.aspx?PropertyID=10002).
But i don't want show propertyid values.
thanks
|
|
|
|
|
Then don't send them through querystring. Or if it is required to send querystring then you can also encrypt that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Use POST method in forms instead of GET.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Hi I am trying to develop a business web site the development is happening on my local machine.
I am using Visual Studio 2005 - C# and ASP.NET 2.
When I press F5 to preview the page the images do not load.
I am also running Internet Information Services on Win XP Pro SP 2. I have shared the folder that has the solution files using IIS and Windows Explorer, but still the images will not show.
Really starting to do my head in....
Help please.
|
|
|
|