473,657 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set drop-down-menu of html file to desired parameter given by URL?

31 New Member
I am creating a html file with a table over xslt. I am using JavaScript for filtering some rows. Is it possible to write some parameters behind the URL to change the drop-down-menu item when I open the html-file the first time?
For example I got the html file "my_file.ht ml".
Is it possible to change this to e.g. "my_file.ht ml -parameter", then read "parameter" with javascript and set my drop-down-menu to Paramter?
I do not want to make a new entry "Parameter" to my drop-down-menu. I just would like to show the parameter item in my drop-down-menu and my table should be filtered by that.
Jun 17 '19 #1
8 1205
gits
5,390 Recognized Expert Moderator Expert
what you like to do here is a typical GET request with a querystring - basically it could look similar to this:

Expand|Select|Wrap|Line Numbers
  1. http://myurl.com?myParam=value
of course you can use JavaScript for that by using the location-object - but since it is a GET request that first goes through to the server you could even set a selected attribute at the serverside already - since there you would have the parameter as well already.
Jun 17 '19 #2
Daniel1111
31 New Member
I am sorry I do not like to read the URL but like to read my file name: I have just explained it wrong. See the following:

I got a html-file in some folder. The file is called "file.html" . I create a link-file to "file.html" on my desktop or anywhere else. The link file's name is "file.html" as well. Now I rename my link file to "file.html -Parameter".

For my "file.html" I am using some JavaScript to filter some rows of a table which is being created.

My question is: Is it possible to read "Parameter" of my link file in my JavaScript and how can I do this?
Jun 18 '19 #3
gits
5,390 Recognized Expert Moderator Expert
well - i dont think that this is possible - the html file is opened in a browser thus your only way to pass something on to that page is through a URL. what your page could do though is - onLoad it could request something.

On the other hand i am wondering whether the parameter is constant as it looks now? In that case you could even hardcode it in a variable in the page's javascript.
Jun 18 '19 #4
Daniel1111
31 New Member
The thing is I may have e.g. 10 link files to my originial file "file.html" . Each link file does have an extra constant Parameter. If I open one link file with the Parameter e.g. "Monday" than I want to show "Monday" in my drop-down-menu. This is a selecting by opening a file. A new entry "Monday" to my drop-down-menu shoud not be added.

So I need a already selected drop-down-menu which depends on the opening of a link-file, not the original file.
Do you understand? If you understand: Do you have any other ideas how I can change my drop-down-menu by opening a link-file? Should be working with JavaScript as I already have a working JavaScript file.

PS: I can also name my link-file just Monday, because it is just a link-file.
Jun 18 '19 #5
gits
5,390 Recognized Expert Moderator Expert
i understand - but as i said - you cannot pass something like that to a website (the page wont know anything about your link file or how it was started in the browser) - but what you can do is creating a shortcut to IE for example with the URL and the correct parameters (with quotes where needed).

if its the case of date/day related selections then you can implement that in JavaScript itself as well so it would always select the correct value.
Jun 18 '19 #6
Daniel1111
31 New Member
I did create a shortcut. But I don't get it how this should work with parameters as it is the same like the link-file. How should it be possible read the parameters with JavaScript then. They are not in the URL as the URL is the original file.. hm
Jun 18 '19 #7
gits
5,390 Recognized Expert Moderator Expert
basically the shortcut would look like this:

Expand|Select|Wrap|Line Numbers
  1. "path to IE exe" "file://path-to-file.html?param=foo"
then in javascript you can simply use the location object to work with the querystring.
Jun 18 '19 #8
Daniel1111
31 New Member
Oh wow. Yes that's nice. Thanks :)
Jun 18 '19 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

12
2669
by: Xah Lee | last post by:
would anyone like to translate the following perl script to Python or Scheme (scsh)? the file takes a inpath, and report all html files in it above certain size. (counting inline images) also print a sorted report of html files and their size. (a copy of the script is here: http://xahlee.org/_scripts/check_file_size.pl )
6
3281
by: Vijay | last post by:
I need to generate HTML files based on the some codes. One HTML file per code. I have the link (ex:http://123.234.345.456/WebPages/GetTestData.aspx?SomeCode=25), by passing the code as parameter I will get the page displayed. But I don't want to display it, instead save those files in one of the network directories that can be accessed by our third party vended web based application. How can I do this accessing and saving HTML files a...
2
2443
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part of the Webform (as if it was a Frame page). Any suggestions? (I am an VB programmer) T.I.Rislaa
1
2363
by: Stephane | last post by:
Hi, I have a html file file that I want to parse with ASP.NET to retreive the value of a custom tag. Let's say that the average html file is about 30 ko. Once the html file is loaded and converted into a single string, I'm using for now is two string.indexOf to find the begin and the end of the desired tag and then a string.substring to extract the data. I'm not using regular expressions since I know exactly what are the tags to find....
7
1891
by: Steve Bugden | last post by:
Hi, I am trying to reference an html page from an aspx file. The intention is that the html file will contain the content for my web site and the aspx will contain the navigation, logo etc. Then I am hoping I can maintain the html files separately via Frontpage. I have tried a server include i.e. <!-- #Include File="c:\somedirectory\somefilename.htm" -->
7
2238
by: Brian | last post by:
I wrote this script here but I cannot get the script to save to the correct month.html. Can someone tell me what is wrong with this code? <html> <head> <title>Monthly Bills</title> </head> <body> <center><font size="4">Total Monthly Bills</font> <form action="billcalculation.php" method="POST">
1
24167
by: amit | last post by:
Hello Group, Does anybody know how I can have a global variable in an HTML file? for instance, I have a fuction (called aFunction() here) and during a mousedown or up event the function is going to be called. The third passing arugment or parameter is myGlobarVar. How can I make this work? since myGlobalVar is defined in a different block of javascript within the HTML file?
5
1773
by: priscilla | last post by:
Hi, I am a beginer in perl programming , my task is to extract content with in form tags from a HTML file.I tried doing it using Regular expression but could not get the desired result as the HTML is not properly formatted in a webpage. can you do it using HTML-parser or HTML-Tree builder? I found out so many tutorials but i am not able to do it using those tutorials. can some one help regarding this? Thank you in advance, Priscilla.
10
7779
by: lg | last post by:
My site consists of many htm pages and each has a banner with my address and some graphic. Now each html page is something like this: <html> blah blah <div> my logo my address </div>
3
6092
by: Mark | last post by:
Hello This might be an odd question. I have an Excel VBA program that searches through a folder for any .htm or .html file, searches the file for any 'hrefs' and prints them to the spreadsheet. For some reason I have noticed that some of the files are HTML Documents, and some are HTML Files, and the program is only searching through the HTML Files. I'm not sure if there is a difference between the two. The only thing that I can...
0
8820
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
8499
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
8601
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
7314
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...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
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
4150
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
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.