|
Found this on the web. It copies the selection in a drop-down to the clipboard. Could probably be modified to copy other text on the page:
<html>
<head>
<script>
function copyText(theSel) {
if (!document.all) return; // IE only
theForm = theSel.form;
theForm.copyArea.value=theSel.options[theSel.selectedIndex].value;
r=theForm.copyArea.createTextRange();
r.select();
r.execCommand('copy');
}
</script>
</head>
<body>
<form>
<select onChange="copyText(this)">
<option value="">Please select
<option value="alpha">A
<option value="bravo">B
</select>
<input type="hidden" name="copyArea" value="">
</form>
</body>
</html>
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
Hello, I am new to this forum.
sorry i got a bit carried away and did not get a chance to post my question the first time. I am new to programming. I am trying to build an ASP form.
So far I was being successful. Until I came across checkboxes.
When I check a checkbox in my form it sends the information to ms access and the checkbox gets checked. but when I try to access the data in my Update form, all my checkboxes are empty. I did an <% = rsGuestbook("standard") %>
after the " just to be sure that the checkbox was checked when it checked it shows True and when is not it shows False.
How can I get the checkbox to show checked in my Update Page?
edgarv
|
|
|
|
|
Hi there,
To check the checkbox you have to use CHECKED attribute. For more info, go to Checkbox
<< >>
|
|
|
|
|
I am afraid I got lost in the explanation. I am very new to asp.
I was able to find something elsewhere
>
but still does not work any ideas?
|
|
|
|
|
Can you send the HTML code generated from asp page???
<< >>
|
|
|
|
|
here is what the Update Form looks like
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("aqpc.mdb")
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM aqtst where ID= "&request.querystring("linknumber")
'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon
%>
<title>AQPC Update Form
<% = rsGuestbook("custom") %>
<% = rsGuestbook("custom") %>
<% = rsGuestbook("standard") %>
<%
'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
And here is what the update_entry.asp looks like
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% 'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query to query the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.Form("ID"))
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("aqpc.mdb")
'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM aqtst"
'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
'Open the recordset with the SQL query
rsUpdateEntry.Open strSQL, adoCon
'Update the record in the recordset
rsUpdateEntry.Fields("customer") = Request.Form("customer")
rsUpdateEntry.Fields("partdescription") = Request.Form("partdescription")
rsUpdateEntry.Fields("sketchnumber") = Request.Form("sketchnumber")
rsUpdateEntry.Fields("revision") = Request.Form("revision")
rsUpdateEntry.Fields("daviespartnumber") = Request.Form("daviespartnumber")
rsUpdateEntry.Fields("customerpartno") = Request.Form("customerpartno")
rsUpdateEntry.Fields("projedtleader") = Request.Form("projedtleader")
rsUpdateEntry.Fields("projectinitiationdate") = Request.Form("projectinitiationdate")
rsUpdateEntry.Fields("planrevisiondate") = Request.Form("planrevisiondate")
rsUpdateEntry.Fields("planrevision") = Request.Form("planrevision")
rsUpdateEntry.Fields("status") = Request.Form("status")
rsUpdateEntry.Fields("custom") =Len (Request.Form("custom")) = true
rsUpdateEntry.Fields("standard") =Len (Request.Form("standard")) = true
'Write the updated recordset to the database
rsUpdateEntry.Update
'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
'Return to the update select page in case another record needs deleting
Response.Redirect "aq2"
%>
somebody suggested this
rsUpdateEntry.Fields("custom") =Len (Request.Form("custom")) = true
so I put it in the update_entry.asp. And now if I write it the regular way
rsUpdateEntry.Fields("custom") = (Request.Form("custom")
I get this error
Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/aqpc/wb/update_entry.asp, line 37, column 56
so I have been using
rsUpdateEntry.Fields("custom") =Len (Request.Form("custom")) = true
I really need help with this. I really appreciate the help. | | | | | | Project
# <% = rsGuestbook("id") %> | | | | | | | | | | Customer |
"
| Project Leader | " | | | | Part Description | "
| Project Initiation Date | " | | | | Sketch Number | "
| Plan Revision Date | " | | | | Revision | "
| Plan Revision | " | | | | Davies Part Number | "
| Custom | "checked > | | | | Customer Part Number | "
| Standard | "checked > | | |
|
|
|
|
|
|
sorry i got a bit carried away and did not get a chance to post my question I am new to programming. I am trying to build an ASP form.
So far I was being successful. Until I came across checkboxes.
When I check a checkbox in my form it sends the information to ms access and the checkbox gets checked. but when I try to access the data in my Update form, all my checkboxes are empty. I did an <% = rsGuestbook("standard") %>
after the " just to be sure that the checkbox was checked when it checked it shows True and when is not it shows False.
How can I get the checkbox to show checked in my Update Page?
In advance thank you for the help.
|
|
|
|
|
Hi.. I'm currently like to do a menu page using C# web application. On the menu page itself i will like to use css(cascading style sheet) and do. From there then i like the page to .aspx. I would like to ask if anyones has done css or who knows it, don't mind share with me as i using css file for the 1st time. Thanks!!
Cheers!
|
|
|
|
|
Hi there,
just simply create ur css file and then make a reference to this file in ur aspx page inside the tag as below..
....
....
<< >>
|
|
|
|
|
Hi.. I just like to ask that.. I have create the code below under css file:
body
{
background-color: yellow;
}
.cwMainBorderColor
{
background-color: #003e56;
}
.cwSideBarHolder
{
border-right: white 2px solid;
vertical-align: top;
width: 2%;
background-color: #003e56;
}
.cwTextBox
{
font-weight: normal;
font-size: 13px;
color: black;
font-family: Arial, sans-serif;
}
.cwComboBox
{
font-weight: normal;
font-size: 13px;
color: black;
font-family: Arial, sans-serif;
}
.cwCheckBox
{
font-weight: normal;
font-size: 13px;
color: black;
font-family: Arial, sans-serif;
}
.cwRadioButton
{
font-weight: normal;
font-size: 13px;
color: black;
font-family: Arial, sans-serif;
}
.cwButtonTiny
{
font-size: 8pt;
background-image: url(Images/Buttons/b_tiny.gif);
width: 40px;
cursor: hand;
color: #2a5f86;
border-top-style: none;
background-repeat: no-repeat;
font-family: Verdana, Arial, Helvetica, sans-serif;
border-right-style: none;
border-left-style: none;
height: 27px;
border-bottom-style: none;
}
And i have also put the stylesheet to the aspx page inside the tag as below..
....
....
But somehow it dosen't work at all!! When i run the aspx it show nothing at all.. Am i missing out on somthing?? Thanks for your help..
Cheers!
|
|
|
|
|
Hello_mouse wrote: somehow it dosen't work at all!!
You mean the css is not applying to the web page?
And make sure that the value of the href attribute is correct? the relative path to ur css file is correct?
<< >>
|
|
|
|
|
Hello,
I'm trying to send the data from my subscription form to two urls, but haven't been successful so far. Perhaps what I need to do is use two forms, of which one is an invisible form.
The idea is that when the submit button is clicked the data in the visible form is copied to the hidden form and both forms are sent to 2 different
urls.
The one url (cgi script) should open in the same window while the second url (autoresponder) opens in a new window. Here's the page where I want to use the script http://www.jimmyroos.com/jvautomator/
Someone suggested I use iframes, but I unforutnately don't know how to integrate that into my html.
Thanks for your help
-- modified at 5:17 Tuesday 6th December, 2005
|
|
|
|
|
You don't need two forms, you can post the same form twice.
Use target in the form to post the form to some other location than the same window, like a new window, a different frame or an iframe. The first time you post the form it has to go somewhere else.
You have to start a timeout with window.setTimeout that will call a function after a short delay. The function should change the action of the form, and the target of the form if needed, then post the form.
The timeout is needed for the form to be able to be posted twice. Just calling theForm.submit() twice in a javascript does not work, as the form is not posted until the javascript ends.
---
b { font-weight: normal; }
|
|
|
|
|
I have a question about an msi installer that fails, seemingly due to the fact that it is deploying to a web site whos home directory is a network directory (UNC path).
The msi has a custom action, the executable for which is not found when the msi goes to launch it. The file is indeed extracted to the correct location on the network, but the msi does not find it.
So ... does anyone have any idea how the msi can be 'instructed' to look in the correct location for the executable it needs?
ta.
|
|
|
|
|
Ok, well I solved that problem by putting the executable in a windows shared folder instead of the install directory.
The whole network directory thing is still a problem though. ASPNetHostingPermission is denied since an application running off a network share is run under the LocalIntranet_Zone code group and therefore only partial trust is in place ... I think.
As a test I tried giving the LocalIntranet_Zone full trust but still get the permission error.
Anyone have any experience with this type of issue?
|
|
|
|
|
Hello Dears
I have problem on date formating.
I am getting MAX Date from SQL DB Using the following Query
SET DATEFORMAT DMY SELECT MAX(CONVERT(DATETIME,TABLE_DATE))FROM TABLENAME WHERE USER_ID='USERID'result of this query is correct.
but the problem is when i am comparing DATEDIFF of date from DB and date from form(ASP FILE).it is working fine for some time and some time it is not working properly.
the Datediff code is here:
x = datediff("d",MaxDBDate,Request("txtdate"))
When i am getting this problem i am restarting my IIS Server after that it is working correctly.so i want to know what is the problem ?????
and my Server's Regional setting is also correct format that is DD/MM/YYYY
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
The regional settings used by IIS might change. The regional settings you set in the control panel is for the logged in user, not for the server in general.
Set locale id for the page so that you are sure what locale is used.
For an example, for swedish format I use:
<%@ Language=VBScript LCID=1053 %>
---
b { font-weight: normal; }
|
|
|
|
|
Hey guys,
1) I noticed that my local cache of web files from a site on my server is being stored in C:\Documents and Settings\Roman\Local Settings\Temp\VWDWebCache . Is it possible
to force VS .NET 2005 to store the cache with my solution file, so i can have a local copy? I tried editing the SLN file... changing it to the right directory but it refused to change..
2) Anyone get this error when adding files/editing files located on a Windows 2003 Server x64 with FrontPage Server Extensions 2002 from inside of VS .NET 2005:
Unable to add 'C:\Documents and Settings\Roman\
Local Settings\Temp\...\Default2.aspx' to the Web. An
error occurred accessing your Windows SharePoint Services
site files... The thing is, it actually adds them to the server, but VS .NET 2005 seems to think it doesn't.. It's just really annoying!
3) Anyone know how I can use Subversion SVN source control in combination with VS .NET 2005 to have source control for this website?
Thanks in advance guys!
r -€
|
|
|
|
|
Hi,
I'm new to running different browsers. I have read how to determine which browser you are running but what I'm experiencing is the screens (Web Pages) looks beautiful using IE and .NET, however when I try to display the screens with FireFox they become a scrambled mess. Is there something different that I need to be doing or an article that someone can post here that I can reference.
In particular the push buttons are in a different spot, one push button is completely missing I suppose it might be behind another button, the rasied panels are gone, and my side bar is discombobulated.
Thank you,
Glenn
-- modified at 21:50 Monday 5th December, 2005
|
|
|
|
|
When a page looks different in IE and Fx it's almost always Fx that renders it correctly.
What doctype do you use?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I'm using doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
This is what is set by MS-Visual Studio. From what I have been reading today Firefox is more to the standard. It's weird that it looks perfect in Visual Studio and IE, but not Firefox. I'm not sure how to adjust or fix it.
Glenn
|
|
|
|
|
Try a more recent standard. Even HTML 4.01 should be a noticeable improvement.
W3C: Recommended DTDs[^]
---
b { font-weight: normal; }
|
|
|
|
|
Hi ,
I am developing a JSP tag library to render a HTML table. But I am not able to find a proper solution to have scroll bars in table.
I have checked the out following solution:
http://www.imaputz.com/cssStuff/bigFourVersion.html[^]
But problem here is:
-I need to use different CSS for each browser
- When I resize the page it doesn't look..table header stays at particular place.
However I could fix the header in IE with a promising level but the same doesn't work in Firefox.
Another appraoch I tried is splitting the table in three seperate tables , one for header, one for body and one for footer, but there again alignment issues are there.
If anybody has worked on this please share your views.
TIA,
Sachin
|
|
|
|
|
Hello Dears
I need help for copying file from client to server using FSO for my ASP Application.
N.Rajakumar B.E.,
Application Developer,
|
|
|
|