473,659 Members | 3,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending values from server side to Client side javascript

Hello,

Can someone help me with the following situation??

I have a Hyperlink within a String like below:

sSql = "SELECT DISTINCT " + "'Action' = '<center><a
href='+char(34) +'ChangeRequest .aspx?ID='+cast (ChangeRequest. ChangeRequest_I D
as nvarchar) +CHAR(34)+'>Ope n</a></center>',"

I want to invoke a Client side javascript function and pass the value
of the ID. How can I accomplish this such when a user clicks "Open" he
goes to a new window with the same ID.

I tried this but it does not work:
On Server side:
sSql = "SELECT DISTINCT " + "'Action' = '<center><a href= 'javascript:
NewWindow('+cas t(ChangeRequest .ChangeRequest_ ID as nvarchar)+
CHAR(34)+)'>Ope n</a></center>',"

On Client side:
function NewWindow(myID)
{
window.open("Ch angeRequest.asp x?ID="+myID,"Wi ndowName","widt h=500,height=60 0");
}
</script>
Jul 20 '05 #1
1 4073
"Renuka" wrote on 13/11/2003:
Hello,

Can someone help me with the following situation??

I have a Hyperlink within a String like below:

sSql = "SELECT DISTINCT " + "'Action' = '<center><a
href='+char(34) +'ChangeRequest .aspx?ID='+cast (ChangeRequest. ChangeRequ
est_ID as nvarchar) +CHAR(34)+'>Ope n</a></center>',"

I want to invoke a Client side javascript function and pass the value of the ID. How can I accomplish this such when a user clicks "Open" he goes to a new window with the same ID.

I tried this but it does not work:
On Server side:
sSql = "SELECT DISTINCT " + "'Action' = '<center><a href= 'javascript: NewWindow('+cas t(ChangeRequest .ChangeRequest_ ID as nvarchar)+
CHAR(34)+)'>Ope n</a></center>',"

On Client side:
function NewWindow(myID)
{
window.open("Ch angeRequest.asp x?ID="+myID,"Wi ndowName","widt h=500,heig
ht=600"); }
</script>


You are trying to launch a pop-up window with URL that is generated
server-side. If so, have your server-side script produce this link:

<A href="#"
onclick="window .open('ChangeRe quest.aspx?ID=I NSERT-YOUR-ID-VALUE-HERE'
, 'your-window-name', 'width=500,heig ht=600')">Open</A>

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.u k (remove [no-spam] to reply)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4251
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the second form when it is called. Both forms are .htm files that call themselves when the submit button is press via the following command in each form: <form method="post" action="<?php $server?>">
9
30072
by: Ken | last post by:
How can I reset the initial form variables that are set with session statements when clicking on a button? I tried this but the function was not called: <?PHP function reset_form($none) { $_SESSION = array(); } ?> <form enctype="multipart/form-data" name="company_info" method="post" action="add_pic.php">
12
12421
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank, 'height=200,width=400,status=no,toolbar=no, menubar=no,location=no resizable=no scrollable=no'); but I can't seem to invoke the client side script from within a Server Side Form. I know I can use the context with to Response.redirect or Server.transfer to return a
20
2479
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
5
1757
by: vanisathish | last post by:
Hi All, I need to constantly update some values to the User Interface. In order to do the updation efficiently, i am planning to run some script in the server side that constantly keeps sending the values alone to the User Interface client. But i need to send some GIF files as well to change the colour of the block diagram. something like send a green arrow when the equipment is UP and red arrow gif file when its down. How can i avoid...
4
1392
by: Trollpower | last post by:
Greetings, im totally new to ASP.Net, so i hope you can help me out here. Ive got some ActiveX Controls, which work great with Windows Forms. Now i have to do some work with ASP.Net, where i also have to use these Controls again. Some of these Controls fire events, like a Scannercontrol, which fires an event if it scanns something. So now i want to know how i can hook to the events on the client side, so that i can react to them and...
3
1270
by: bryu1 | last post by:
Hello, I'm trying to find a way for a web page to do some file processing in the client side before sending it to a server. Is there a way to do that in php (or in some other language)? Thanks Gnurto.
4
1447
by: Eric Layman | last post by:
HI, Im on dotnet 1.1 I've generated extra checkboxes, textboxes via client side javascript: eg: var inputElement = document.createElement('input'); inputElement.setAttribute('type', 'radio');...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7359
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.