473,737 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Java Script and ASP

I have a java script

function enableServerLis t()
{document.getEl ementById("ddlS ervers").disabl ed=false }
function disableServerLi st()
{document.getEl ementById("ddlS ervers").disabl ed=true }

This greys out a drop down list as expected. The problem is, when I
click on the "get Report" button, I need a way to say in asp code:

if the drop down list ddlServers is disabled then bla
else
bla

The apparent problem is that when java disables it, the ddl properties
page still holds on to an enabled=true property.

I need to be able to write a code(on the asp code page) to get the
status of enabled true or false for a Drop Down List that java script
has "disabled"

Mar 6 '06 #1
7 1970
wrote on 06 mrt 2006 in microsoft.publi c.inetserver.as p.general:
I have a java script

function enableServerLis t()
{document.getEl ementById("ddlS ervers").disabl ed=false }
function disableServerLi st()
{document.getEl ementById("ddlS ervers").disabl ed=true }

This greys out a drop down list as expected.

This above is clientside javascript code
The problem is, when I
click on the "get Report" button, I need a way to say in asp code:

if the drop down list ddlServers is disabled then bla
else
bla
ASP is [a platform for] serverside code in languages
like vbscript and j[ava]script.

Serverside code cannot access clientside values.
The apparent problem is that when java disables it,
Java is another language altogether,
has nothing to do with javascript but the name.
the ddl properties
page still holds on to an enabled=true property.
I don't understand what you mean.
What is a "page" that "still holds on"?

It is the browser DOM that contains the enabled, I presume.
I need to be able to write a code(on the asp code page)
What is an "ASP-code page"?

There is a .asp file on the server that is executed on the server,
executing it's asp code and rendering html content that is sent to the
client. This html code can contain the source of to be executed
clientside code [in javascript, among others]
to get the
status of enabled true or false for a Drop Down List that java script
javascript, not java script
has "disabled"


The browser DOM of the list seems to contain "disabled" in the browser.
ASP works serverside and has no knowledge of browsers or their DOM.

So only clientside code can enable it again.

btw, I hope that by ASP you do not mean ASP.net ????

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 6 '06 #2

db****@gmail.co m wrote:
I have a java script

function enableServerLis t()
{document.getEl ementById("ddlS ervers").disabl ed=false }
function disableServerLi st()
{document.getEl ementById("ddlS ervers").disabl ed=true }

This greys out a drop down list as expected. The problem is, when I
click on the "get Report" button, I need a way to say in asp code:

if the drop down list ddlServers is disabled then bla
else
bla

The apparent problem is that when java disables it, the ddl properties
page still holds on to an enabled=true property.

I need to be able to write a code(on the asp code page) to get the
status of enabled true or false for a Drop Down List that java script
has "disabled"


Two possible solutions: Either use ASP to set the disabled property
rather than JavaScript. That way the value is available to any other
ASP code you write. Or, change your javascript function so that it
writes a value to a hidden form field depending on whether disabled =
true or false. You can access that through ASP.

--
Mike Brind

Mar 7 '06 #3
db****@gmail.co m wrote:
I have a java script
Do you walk on car pet? The terms "javascript " and "Java script" describe
two things wholly distinct from one another.
function enableServerLis t()
{document.getEl ementById("ddlS ervers").disabl ed=false }
function disableServerLi st()
{document.getEl ementById("ddlS ervers").disabl ed=true }

This greys out a drop down list as expected. The problem is,
when I click on the "get Report" button, I need a way to say
in asp code:

The apparent problem is that when java disables it, the ddl
properties page still holds on to an enabled=true property.
You never manipulated an "enabled" property. You manipulated a "disabled"
property.
I need to be able to write a code(on the asp code page) to
get the status of enabled true or false for a Drop Down List
that java script has "disabled"


There is no concept of "enabled" unless you assign it yourself. It's not in
the DOM:
http://www.w3.org/TR/2003/REC-DOM-Le...ml#ID-94282980

Nor is it an HTML attribute of SELECT:
http://www.w3.org/TR/html401/interac...ml#edef-SELECT

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 7 '06 #4

<db****@gmail.c om> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
I have a java script

function enableServerLis t()
{document.getEl ementById("ddlS ervers").disabl ed=false }
function disableServerLi st()
{document.getEl ementById("ddlS ervers").disabl ed=true }

This greys out a drop down list as expected. The problem is, when I
click on the "get Report" button, I need a way to say in asp code:

if the drop down list ddlServers is disabled then bla
else
bla

The apparent problem is that when java disables it, the ddl properties
page still holds on to an enabled=true property.

I need to be able to write a code(on the asp code page) to get the
status of enabled true or false for a Drop Down List that java script
has "disabled"


It's embarrasing the number of unhelpfully critical replies you have
received.

The disabled state of the control isn't persisted between form submissions.
Add a hidden field to hold the enabled/disabled state of the server list and
modify it's value in the functions.

In ASP code (note guys this is an ASP question) read the value of the hidden
field and use it something like:-

<select id="serverList " disabled="<%=Re quest.Form("ser verListDisabled ")%>" >
Anthony.
Mar 7 '06 #5
Anthony Jones wrote:

It's embarrasing the number of unhelpfully critical replies you have
received.


Huh? You are about to give the same answer that was given by Mike Brind in
this thread ...

Actually, your reply is less "helpful" than his since he suggested two
alternatives compared to your single alternative :-)

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 7 '06 #6
"Huh? You are about to give the same answer that was given by Mike Brind in
this thread ... Actually, your reply is less "helpful" than his since he suggested two
alternatives compared to your single alternative :-)

:$ Yup yet more embarrasment. Mike is the only helpful guy in this thread
:-)

Anthony.
Mar 7 '06 #7
Anthony Jones wrote:
It's embarrasing the number of unhelpfully critical replies
you have received.
A reply that gets the OP to think about the causes of behavior is FAR MORE
helpful than one that just tells him one possible solution. Teach a man to
fish.

The disabled state of the control isn't persisted between form
submissions.


Well...it sort of is:

"Disabled controls cannot be successful"
http://www.w3.org/TR/html401/interac...#adef-disabled

Therefore, if (Request.Form.C ount && !Request.Form(" ddlServers").Co unt),
then the control certainly was not successful, so there is a good chance it
was disabled.

And when I say there is a good chance, I mean that you can easily design
your application so that this condition is sufficient to assume it was
disabled. More importantly, you can make that condition the sole basis for
assigning the DISABLED attribute.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 7 '06 #8

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

Similar topics

4
3481
by: Andy R. | last post by:
Hello everyone, I've spent quite some time now, looking for some information on how to get this done, sadly none has helped me much, though. I have a bit of java scrpt on a webpage (.php) to aquire the screen resolution of the visiting user. Now I need to pass the java variable to another variable on the same document. I have a feeling, this will not be easy - as java is client- and php server-sided. Now, if my assumption is corect,...
4
1758
by: lawrence | last post by:
I want to offer my friends a ping service, where certain of their pages will be called once a week. My impression is that no PHP script can be made to run very long. Assuming a situation where I don't have access to cron, should I write the service as Java application and set it to run forever on my webserver? Or let's put it another way. Assume I want to write a remind service, where people are reminded of friend's birthdays. Should I...
4
12083
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble running a long Java command from a shell script. Firstly, my Solaris (8) / Java setup. Mu machine already had Java 1.2
2
2772
by: enclume42 | last post by:
Hello, I am a pure Linux guy. I wrote a Java program that is going to be used by some Windows people, and I wish the startup of the program to be as simple as possible, namely to double-click on the icon of a BAT script on the CDROM. The program accesses files in a directory which path is given as an argument on the command line. The script I have now is the following: --- start of script ---
0
1498
by: Mircea Pleteriu | last post by:
Hi all, I have created a .NET Windows control with c#. I have placed the control on a HTML page within the OBJECT element. Everything works fine up to now. Now, I wanna implement the following stuff that the control must support. The control must provide a method called InvokeJavaScriptFunction The prototype of this method is:
4
1845
by: Don Grover | last post by:
I hope some one can help, I have a html table that is created with asp that has a row of repeated buttons down the side. these call a page passing a query string with invoice number. I need to get a Java Yes/No dialog up and on yes call the hyperling query string. I can do this with a single hyperlink but not passing on the query string and invnumber Here is my Response Write link
4
2938
by: Jeff | last post by:
Hi, Are there anyone can help me? My questions are as following: Because I have a tools bar which coding with javascript, it will reuse very often. So I want to separate the client-side java script code with asp.net . And make the client-side java script code as user defined cotrol. But I only find the RegisterClientScriptBlock method, it only can insert java script code to <body></body> in html. But my java script code must insert...
9
2391
by: Mickey Segal | last post by:
The long-simmering Eolas patent dispute: http://www.microsoft.com/presspass/press/2003/oct03/10-06EOLASPR.mspx has led to an optional Microsoft Update: http://support.microsoft.com/kb/912945/en-us that creates non-JavaScript problems that can be fixed using JavaScript. With the Microsoft update installed, Java applets (as well as other content such as Flash videos) are unable to receive user input until an activating click or key press....
4
6189
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages generated are written to a log file. A project team working in the same company as me here would like to use this loading utility. They write UI applications for Windows using Java. They were able to launch the Python script from within Java by...
0
2575
by: tosreejithp | last post by:
Hi, My first problem was i am not able to compiled a file from java script to java class.Now its clear and working fine..now i can convert a java script file to java class by Rhino Java Script Compiler.But now i am facing 1 more problem.i want to run that java class in IntelliJIdea.but its runnig with no error and not getting the out put.This is the converted java class for printing "HelloWorld". import org.mozilla.javascript.*; import...
0
8966
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
8786
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
9467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9257
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
6052
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4567
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...
0
4823
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2192
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.