Sending Values From Server Side To Client Side Javascript

Jul 20, 2005

I have a Hyperlink within a String like below:

sSql = "SELECT DISTINCT " + "'Action' = '<center><a
href='+char(34)+'ChangeRequest.aspx?ID='+cast(Chan geRequest.ChangeRequest_ID
as nvarchar) +CHAR(34)+'>Open</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('+cast(ChangeRequest.ChangeRequest_ID as nvarchar)+
CHAR(34)+)'>Open</a></center>',"

On Client side:
function NewWindow(myID)
{
window.open("ChangeRequest.aspx?ID="+myID,"WindowName","width=500,height=600");
}
</script>

View 1 Replies


ADVERTISEMENT

Passing Values From Client Side To Server Side Python Script

Jun 1, 2009

I am developing a web form using python cgi which has two list boxes. On selecting a value from the listbox1, the list box 2 should get auto populated with appropriate values (which are taken from the DB). I have written a javascript function to get the selected value from the list box1. But I am struck with passing the values from the javascript to the python function written in server side in which I have written the DB related stuffs.

View 1 Replies View Related

JQuery :: Encode/decode Of JSON - Server-side And Client-side?

May 26, 2009

I am building a client-side and server-side solution and want to use JSON through Ajax in both directions. I have ASP or JavaScript server-side, though Microsoft's support of server side JavaScript seems nil, so I am reluctantly conceeding to use ASP. I'd appreciate suggestions on available solutions to encode/decode JSON on the server-side (ASP or JavaScript). I don't plan to load jQuery server-side so that rules out plug-ins. I'd also like to know what is the latest client-side encode/decode for JSON. Is it built in jQuery or a plug-in? In both server and client, decoding JSON securely is key, so using eval () to decode is out.

View 1 Replies View Related

Pass Parameter From Server Side Php To Client Side Script?

Aug 22, 2011

On the server side I have a php generated session parameter.
I need to pass it to javascript on the client side page.

I saw on the web the following solution code...

I tried it but it did not work.

View 1 Replies View Related

Adjusting Code To Use Either Server-side Or Client-side Validation--NOT BOTH?

Sep 11, 2009

I have the following PHP code, which uses server-side validation, which works fine. It the user leaves the text field empty it stores an error in a session array which is outputted on the page where the $_GET['id'] variable came from. I also implemented a snippet of javascript code that just checks to see if the cell is empty and throws up alert box. The problem is that both the javascript code and php error validation are both running when I click submit. The PHP code should be a backup to the javascript code in case the user has javascript turned off. The client-side validation should be the default. Not sure if this change should be made in my PHP Code or Javascript Code.

PHP CODE:
session_start();
require_once("../Modules/Connection_Functions.php");[code].....

View 1 Replies View Related

Client Side Script With Server Side Controls

Jul 20, 2005

I have a web form that has a checkbox on it and a textbox associated
with it. I want the textbox to be displayed when the checkbox is checked
and I want this to happen on the client-side instead of posting back to
the server. The checkbox is a server control (asp:checkbox...). I can
write some codebehind that will display an alert message upon checking
the box that looks something like this...

Page_Load...

Dim s As String
Dim scriptString As New System.Text.StringBuilder

chkExpDate.Attributes.Add("onclick", "alertmsg()")
scriptString.Append("<script language=JavaScript> function alertmsg()
{")
scriptString.Append("alert('hi'); }<")
scriptstring.Append("/" + "script>"
s = scriptstring.ToString()

Page.RegisterStartupScript("startup", s)

End Sub

I used this as a test to make sure the server control was running the
script. But, when I change the script to assess the value of the server
control checkbox such as checked = true, I get errors and if I just try
to display the asp:textbox, it doesn't work either.

View 1 Replies View Related

Server Side Or Client Side Validate?

May 14, 2007

I had a import function which allow for user import data from excel file. The number of row was dynamic, mean that user may import hundred or data or may thousand of line.

should i perform client side or server side validate?

the problem i faced was if the import thousand of line, i need display out thousand of text (multiple by 6, cause 1 got 6 fields)

the take a lot of time to loading and cause browser "hang" (response slow)

any solution for me?

View 13 Replies View Related

Converting Client Side CMS To Server Side?

Jun 16, 2010

I have the following client-side Content Management System VBscript which works great, now I'm looking at getting it to work server side so that I can update using online login rather than offline and having to upload files. To be honest, I have no idea where to begin with this,

Here's the full VB script:

[Code]...

View 1 Replies View Related

Post Data To Server From Javascript On Client Side

Jul 23, 2005

I have a few values and variables that I want to post to a server
(without using a SUBMIT button). Is there a way to post data from
within javascript - do sockets or connections have to be open for this
to work?

View 5 Replies View Related

Calling Server-side Function From Client Javascript

Nov 29, 2005

I am developing an ASP.NET (C#) application and need some help. I wish
to call a server-side function (in the code-behind "file.aspx.cs") upon
a user clicking on the "X" to close the browser window. Is there a way
to postback and call a server-side function when this happens? I am
aware of the browser's native "onunload" event, but am not certain that
what I'm looking for is actually possible.

View 2 Replies View Related

Sending Jscript Client Side Variable To Asp File

Sep 6, 2005

I have an html page, with jscript inside. some variables, some of them
multidimensional arrays. i need to send this information, which can be
changed by the user, to an asp file. the only way i could think of, is
putting it inside hidden box and sending the form. is there any more
elegant way?

View 6 Replies View Related

Request Server Information Client Side

Jul 23, 2005

The only way i can think of doing such a thing is having an active
server page that returns an image, that is generated on the fly. As
long as there is no caching on the client this in theory will allow
the client to perform an action on the server and display an image
generated on the fly as a result of this action without actually
reloading the page, simply by requesting an image.

View 3 Replies View Related

Difference Between Client And Server Side Script?

Nov 16, 2011

what is the difference between client side JavaScript and server side JavaScript? Client side JavaScript is directly embedded in the HTML code...what about serve side scripting?

View 1 Replies View Related

JQuery :: Show Server Side Process On The Client Using Ajax?

Feb 22, 2010

My login to the site is being processed using ajax, which does a redirect to the members page upon succesfull loggin in.The login feature however can in fact take a while because we need to initialise quite some data when a user logs in (his details, but also his privileges are loaded, his personal menu based on these privileges are being loaded, we are loading shopping cart info, we are initialising personalisation settings, and a whole lot more.It sounds like a big thing, but it isn't, and once logged in, the application is going great. the only thing is that the login proceure can take 3 - 4 seconds, and I would like to be able to show the client the progress of the serverside script:

"Searching your account..."
"Validating your privileges"
"Initialising your personal menu"
blablabla...

To do this, I might just call an ajax call that starts the login procedure, and then issue another ajax call every 1 second or so to update the status based on some session variables I set in the login procedure and that I can serve to the client when th next ajax calls come in, but I would love for this to work a little nicer as in just needing to initialise ONE ajax call which can send back statusupdates from the server...

View 1 Replies View Related

HTML Forms And Client-side Validation W/ Server Data?

Oct 28, 2010

I know that Javascript is client side, but I'd like to know the best way to populate HTML drop downs in real time based on information typed in the other HTML form fields with information found on the server as opposed to the client.For instance if a user wants to select certain files located in a directory on the server, as they type in the pathname supposedly containing the files the drop downs continually refresh themselves with the server files listed in that directory (if it exists, and apache has permissions to see what's inside) as if it was showing client files instead.

What would be nice is if my browser could continually query the server for some of its private information and not have to refresh itself to obtain it, whether that means the server-side would have to continually refresh itself makes no difference to me as long as the client-side doesn't have to. But I guess this is not possible because no matter what you would have to at least refresh the client-side page once?Submitting the form to a CGI or PHP script would not work because I need this functionality to help populate the form BEFORE I send it.I would like to not have to press a button to update the form every time I change the pathname and need to update the drop downs since this would be annoying.

View 2 Replies View Related

Client Side Cookie - Multiple Key Values Pairs

Feb 2, 2010

I need to have this setup as a client side cookie (javascript disabled - no problem).

I need to store in the cookie page name, first name and last name (and there are about 4 more items). Should i save a different cookie for each item here (all javascript examples show this) or can i do some thing like this?

View 5 Replies View Related

Scale With Client-side Javascript

Jul 23, 2005

Provided an interface to a search engine in which the onchange event in
a select list element generates between 7 and 13 additional elements
depending on the option chosen.

Here's what the customer *now* wants to do:
Generate between 200 and 350 elements. Furthermore, the logic is going
to be more complex.

I would be happy to make that happen, however here's my concern: I'm
already doing this from the server side, using CGI. I wonder what is
going to happen when we put that degree of "work" on the client browser.
I would welcome comments, caveats, or pointers to documentation and
discussions on this subject.

View 2 Replies View Related

MySQL Use With JavaScript, Client Side

Jul 20, 2005

I would like to write a little program to read data in a MySQL database.
What do I need?

Is there a specific "JavaScript Include" to make this work? Do you have examples or site links to help me?

View 4 Replies View Related

Client Side JavaScript Applications

May 2, 2001

I'm building some client side JavaScript applications, one of these is a missing piece puzzle. There is one bug that I am aware of, where one piece may move over another, but this doesn't happen untill you have been playing for ages.

I'm trying to test the win condition, but haven't yet managed to complete it

Anyone with some spare time, or just some boredom, wanna have a go? Code:

View 3 Replies View Related

Javascript To Resize Image On Client Side!

Mar 14, 2007

I'd like to see and use a javascript to resize an image.

I've creating a site and I'd like that only this image will be resizable automatically based on resolutions (800x600, 1024x768, 1280x1024, ecc...)...

View 8 Replies View Related

Client-side Scripting: Javascript Or VBScript

Mar 17, 2002

Has anyone got any pros and cons for using Javascript over VBscript or vice-a-versa, Code:

View 7 Replies View Related

ASP.NET 2.0 Breaks Client Side Javascript! Is WebResource.axd The Issue?

Jan 12, 2006

I moved over client side javascript code from an asp.net 1.1 project to
an asp.net 2.0 project. When I view the web page, I get all these "is null or is not object" javascript errors.

Is there something that I am missing? Is WebResource.axd the issue?

View 3 Replies View Related

Retriving Data From Some Asp.net Object To Client Side Javascript

Mar 9, 2007

How can I, for example, retrive data from Profile object (or what so
ever) to some variable declared in javascript tag on client side?

For example, let's say I have this code in Some_Page.aspx:
....
Profile.Name = "Some Name";
....

And I have some variable in java script tag:

var someVariable;

How can I get this "Some Name" from Profile.Name to someVariable?

View 1 Replies View Related

Getting Unix Login Name Or Home Dir From Client-side JavaScript

Jul 20, 2005

Is there any way at all I can get a user's login name from within
JavaScript on Unix/Linux with Mozilla browser. If not, how about the
home directory? I know there are *usually* variables accessible via
navigator.preferences() that contain the info, but I have found none
that can *always* be expected to exist.

View 1 Replies View Related

Pass Variable Values To Server Side Code?

Jan 22, 2009

how to pass javascript variable values to server side code i used a hidden field and passed he value in it . i do get the value in hidden field but on using request("hdfield") its blank how do i get the value frm javascript

View 1 Replies View Related

Javascript On The Server Side

Jul 23, 2005

However, this piece of Javascript uses some other script which is large.

<script src = "./js/tmp.js".....>

This will work if the file "tmp.js" is local. However this reduces the
portability of my *utility* Javascript
as users have to have that "tmp.js" for every webpage they have (if they
want to use it :D)

I thought of uploading "tmp.js" it to somewhere and change my code to

<script src = http://www.somewhere.com/js/tmp.js ....>

The all the users have to do is copy the piece of code that I wrote
BUT THIS DOES NOT WORK. I TRIED IT.

My questions are:

1. Is there something wrong with server-side Javascript? Or am I missing
something?

2. Is there another way to make my code portable?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved