Got A Dropdown Which Reads The Filename From The Database?

Jun 16, 2011

I'm using Joomla. I've got a dropdown which reads the filename from the database. When the user selects it I want an onchange event to open the pdf.I've been at it for 2 days now.

<?php
$con = mysql_connect('localhost', 'root', '');
if (!$con)

[code]....

View 6 Replies


ADVERTISEMENT

Date Of Birth Dropdown And Database ?

Dec 21, 2011

<script type="text/javascript">

This script when the year is selected chooses 2011-2030 but I want like 1900-2011 How do I fix this and then how would I make sure that it isn't blank and then sends this data to one field in my database called "dob" in form "0000-00-00"..

View 6 Replies View Related

Ajax :: Dropdown Menu Pulling Info From MYSQL Database?

Jun 20, 2009

I need to create three dropdown boxes (box 1:colour, box 2: price, box 3:brand) and when the user presses "GO" they are returned with the correct information, pulled from corresponding fields in my MYSQL database.

For example, colour: silver, price £100-£200, brand:samsung...should return 5 items on the page. I do not need the dropdown boxes to populate depending on ther previous selection - they are static, so to speak. If possible, I would like the information to be retuned to my page without the URL changing, which leads me to think I will need to be ausing ajax....?

View 2 Replies View Related

OnChange Event - Populate Dropdown Fields Separately From Database

Dec 17, 2011

I have two drop-down fields that are populated separately from the database. Here is my HTML/PHP code
Drop-down field #1
<tr class=bodyTRstyle>
<td width="35%"><p align="left">Venue</td>
<td class=fieldTDstyle width="269"><p align="left">
<select name="VenueName" class=VenueName><option selected><?php echo $VenueName?></option

<?php
$SelectVenueQuery="select * from venue order by VenueName";
$SelectVenueResult=mysql_query($SelectVenueQuery);
while ($VenueRow=mysql_fetch_array($SelectVenueResult)){
extract($VenueRow);
echo "<option value='$VenueName'>$VenueName";}?>
</select></td></tr>

Drop-down Field #2
<tr class=bodyTRstyle>
<td width="35%"><p align="left">Results</td>
<td class=fieldTDstyle width="269"><p align="left">
<select name="GameResults" class=GameResults><option selected>
<?php echo $GameResults?></option
<?php
$ResultsQuery="select * from result order by ResultDate";
$ResultsQueryResult=mysql_query($ResultsQuery);

While ($ResultsRow=mysql_fetch_array($ResultsQueryResult)){
extract($ResultsRow);
echo "<option value='$ResultDate'>$ResultDate";}?>
</select></td></tr>

This code works well as long as the two drop-downs are independent of each other. The result table has VenueName as an element, so each venue has a set of result records in the result table. This is how I want to change it: The Venue dropdown will remain as it is. Once the Venue Name is selected I want the result dropdown to populate with ONLY the result records containing a match on VenueName that was selected in the venue dropdown. How do I do that? Is it with a onChange Event? What are the changes that need to be made? How do I communicate to the second drop-down what was selected in the Venue drop-down??

View 10 Replies View Related

IFrame That Reads .txt Files AND Scrolls To The Bottom Of The Page?

Sep 30, 2011

I have a website on a Shared Server at work that I'm trying to get an iFrame to view the contents of a lengthy .txt file and I need it to AUTOMATICALLY scroll to the BOTTOM of the .txt file when the webpage opens. I have a script that will scroll .htm files to the bottom but I can't get it to automatically Scroll a .txt file to the bottom (Best I've gotten is a button that you click which scrolls to the bottom) but I need it to Automatically do it when the page opens.

If it matters... My .txt file is actually a .LOG written in notepad with the 1st word ".LOG" which automatically inserts the Time & Date Each time the file is opened and it opens with the Cursor Automatically at the Bottom of the page.

View 9 Replies View Related

Dynamically Change Values Of Second Dropdown By Using Database Values?

Nov 22, 2010

I am doing an application with two dropdown boxes.Once we change the value of first drop down using database values ,the values in the second drop down should change..then click on done it should display the data from databse.. first dropdown :contains country names second dropdown :contains city of particular country..My problem here at is displaying values on second drop down based on first drop down selection:

View 7 Replies View Related

JQuery :: $.get Only Reads A Certain Number Of Nodes From A Local Xml File Before Failing?

May 3, 2009

I'm having trouble reading a not-so-large local XML file. The following code works fine for under 70 nodes:

// load values from the xml file
$.get('dic.xml', function(dicXml){
$('node', dicXml).each(function(){
var literal = $(this).find('literal').text();

[Code]..

View 2 Replies View Related

When Gets To The End Of The Cycle Of Images It Reads The Last Image As The Last One To Reach The Left Hand Side Which Is Obviously Quite Unattractive?

Sep 14, 2011

I'm busy creating a website and I've implemented a gallery of sorts using this script below to make it move the images, however when it gets to the end of the cycle of images it reads the last image as the last one to reach the left hand side which is obviously quite unattractive. So all I would like to know is if there is someone who can alter this code to make it so the last image is read on the right of the block thus resulting in no blank blocks. You can view it in action at http://mcphotography.co.za/corporate.html.

Code:
var Spry;
if (!Spry) Spry = {};

[code]....

View 1 Replies View Related

Automatically Reads Contents Of Text File On Page Load / Updates Every 1000ms?

Nov 10, 2009

I have some sample ajax code i have been toying around with.I have it updating & working properly, but you have to click a button first.How can I set it so that it automatically reads the contents of the text file on page load, and updates every 1000ms?I was trying onload=setinterval(JavaScript:xmlhttpPost("status.php"),1000)[code]

View 1 Replies View Related

Piece Of Code That Reads A Table And Inserts New Entries Into A Listbox On The User Side?

Jun 16, 2010

What I want is a piece of code that reads a table and inserts new entries into a listbox on the user side. I dont want to have to "refresh" the page to get new entries into the listbox.Essentially, the table will get updated by an app on one side and I want users to be able to view the updates as they occur.

View 2 Replies View Related

Passing A Filename

Jul 23, 2005

<script type="text/vbscript">
Dim objWord
Sub Btn1_onclick()
call OpenDoc("K:DeloitteTeam1 Status reportJavaProgramshi.txt")
End Sub

Sub OpenDoc(strLocation)

Set objWord = CreateObject("Word.Application")
objWord.Visible = true
objWord.Documents.Open strLocation
End Sub
</script>

I would like to pass the filename used above in the button code below so
the above code could be coded only once and then mutiple button code
could be used.

<td><INPUT TYPE=BUTTON NAME=Btn1 VALUE="Requirements Template"></td>

View 2 Replies View Related

Date As Filename

Jul 20, 2005

I have a series of pictures that are named as dates, example November 10th,
2003 would be 10102003.gif

Why does the following script fail?

<script language="JavaScript"> ....

View 6 Replies View Related

Path Without Filename

Apr 26, 2005

Can I subtract the filename form the location.pathname ex:
Before = 'file:///c:/afolder/awebsite.html'
After = 'file:///c:/afolder/'
Or is there any other way to get the directory without the name of the file being veiwed?

View 1 Replies View Related

JQuery :: Html To Do Some Database Manipulation - Database Transaction

Jan 11, 2011

Can i use single jquery and html to do some database manipulation i.e. database transaction.

View 1 Replies View Related

Random Word Database - Able To Grab Words From A Database ?

Aug 10, 2010

I want to be able to grab words from a database with javascript. How do I do that?

View 2 Replies View Related

Database Connection - Connect To A Database And Execute Some Queries

Oct 31, 2011

I have been searching how to connect to a database and execute some queries, and then use the data that I get to populate some tables in a web page, all this using javascript.

I am confused because I have seen in some webpages that javascript is not designed to connect with databases, and also I have see other pages where they say that it is possible.

Does anyone know if it is possible to use javascript to connect to a database (informix), and execute some procedures or queries?

View 4 Replies View Related

Ajax :: Script Which Reads Text String From Php Script

May 12, 2009

I'm trying to create an AJAX script which reads a text string from a php script. I've managed to do this and it works fine. Problem is, when the php script is ran, it's supposed to add a record to a database.If I run the script through a browser it does this, but when called from the ajax script it doesn't. I've managed to get this to work before when calling xml, but as I'm doing it a different way as it's calling text.

View 8 Replies View Related

Extract Filename Of Html

Jun 17, 2007

This is a simple script I though of to get the filename of container for html.

Note: this only is tested on mozilla firefox 2 on windows vista

document.write("<a style='display:none' id='zFilenameFinder1' href=''>q</a>");
document.write("<a style='display:none' id='zFilenameFinder2' href='b'>q</a>");
var zDocURL = document.getElementById('zFilenameFinder1').href;
var zCompareURL = document.getElementById('zFilenameFinder2').href;
zCompareURL = zCompareURL.replace('b','');
var zFilename = zDocURL.replace(zCompareURL, '');
alert(zFilename)//filename handler


it works by creating two relative urls. one's href is blank, which when called by link.href returns the absolute value, giving the absolute link the page, then you compare it to a link that has a relative href of "b" which can be compared to the other link to give you the whole url

View 2 Replies View Related

Set The Cookie Filename With JavaScript

Feb 16, 2006

Is there a way to set the cookie filename with JS?

Currently it is setting it as 'asp/' (my directory). Can i specify it?
This is my code:

function setCookie(NameOfCookie, value, expiredays)
{
// Three variables are used to set the new cookie.
// The name of the cookie, the value to be stored,
// and finally the number of days until the cookie expires.
// The first lines in the function convert
// the number of days to a valid date.

var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

// The next line stores the cookie, simply by assigning
// the values to the "document.cookie" object.
// Note the date is converted to Greenwich Mean time using
// the "toGMTstring()" function.

document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

and this is how i call it:

setCookie('OpenJaw', 'true', &#391;');

View 2 Replies View Related

Lightwindow Image Filename ?

Jun 8, 2010

I have recently come across the need for using the name of the image file within js, but I can't locate it. I am well versed in php, but my js skills are noticeably weak. About 25% of the way into the (partial) lightwindow.js I have placed a comment that shows where I need to access the current image filename.

Code:

This will stop image flickering in IE6 when elements with images are moved try

CODE:

View 8 Replies View Related

Passing Filename OnChange ?

Feb 27, 2010

I'm trying to figure out a way to pass the filename before submission... I think I have to make an onChange command on the file field, but not sure how...

This is what I have done so far:
<script type="text/javascript">
function theimage(){
var imgURL = document.getElementById('myfile').value;
ste.execCommand("insertimage", imgURL);
}
</script>

<input name="myfile" type="file" size="30" onchange="theimage();">

I'm trying to pass the value to theimage as sson the filename changes, but I'm doing something wrong...

Any help is apreciated...

View 8 Replies View Related

JQuery :: Get Filename Of Inline Js File?

Oct 18, 2010

I don't find something about this, but perhaps someone have a solution.

Below is my problem :

I overload standard document.write in order to defer some js calls ( like ads ) with a lazyload feature. [code]...

My question is : in my document.write overload, is there anyway to catch the filename of the js script that call the document.write ?

One precision : I've got no possibilities to change distant js files.

View 1 Replies View Related

Restoring A Filename And Path On A FORM?

Nov 14, 2010

how to save form values in cookies, etc. for use when re-displaying the forms. for example, after an error has been detected. Naturally, PHP allows you to do this with $_SESSION variables.

But no one seems to have cracked the problem with FORMs having file uploads. Browsers will send the file to the server and the name, but not the path on the client computer (I suppose for security reasons).

So, if you want to re-display the page, you can fill in all the form data in your PHP script so that the user doesn't have to re-enter everything. But, since your PHP script only knows the NAME of the uploaded file, and not the path, whatever your fill in for the "xxx" in <input type="file" value="xxx" /> will be wrong.

View 4 Replies View Related

Specify Word Doc Filename In Save Dialogue Box

Sep 28, 2010

I have a webform that creates a word document as it's ouput (yes I know it only works on IE).
function createWordDoc(){
Doctxt = "some text here"
var w=new ActiveXObject("Word.Application");
w.Visible=true;
w.Documents.Add();
w.Selection.Font.Name="Times New Roman";
w.Selection.ParagraphFormat.Alignment = 1;
w.Selection.TypeText(Doctxt);
w.Documents.Save();
}

My issue is with saving the file. At the moment, in the above code, it opens the save dialogue box, and populates the filename field with the first line of text in the document. What I want to be able to do is populate the filename field with a variable filename created by the function. I've tried the snippet below, which works with the dynamic filename, but it autosaves the file to "My Documents" folder without prompting. I need to be able to allow the location to be changed.
var FileName = "Myfile.doc"
w.ActiveDocument.SaveAs(FileName);

View 1 Replies View Related

Pull Variable From Cookie Filename?

Oct 11, 2011

I'm working on an internal website at work and employees have a cookie created when they login to the customer support tool. The filename is cookie:username@domain.com/ and I'd like to use javascript to pull a variable for their username to plug into a URL for a unique link when they're viewing one of our intranet pages.

@domain.com/ will always be the same but I don't know how to pull the unique username from the filename of the cookie. I don't need to actually read the cookie.

View 2 Replies View Related

Download File With Current Date In Filename

Aug 6, 2007

I am new to this forum, so your help would be most appreciated.

I am trying to create a javascript where, on clicking a button, I will
be able to download the latest log file. But the log filename changes
everyday as it takes the current date as part of the filename. eg.
EMEA_20070806 i.e. EMEA_yyyymmdd
Also, the previous day's log file is stored in the same directory.

How can I create a button where it will download the latest log file
at all times?

View 2 Replies View Related







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