Output Text In Two Separate Divs?

Nov 4, 2009

I've used a function to out put two lists, - loco numbers and loco names - which I want to display side by side on a page, either in two adjacent divs or in a two-column table so that viewers can straight away reference the numbers with the associated names.

I can output it as a document.write - but that just results in one continuous list of numbers and then names. explain how to output the two lists in two separate divs.

View 3 Replies


JQuery :: Show Two Separate Divs, Hide Divs On One Click?

Aug 19, 2009

I'm looking for some javascript to work with wordpress (jQuery preferrably) that will show/hide multiple divs on one click.

I had one working but it was kinda janky because it was causing me to have two divs with the same ID on one page. No good.

Since I updated to wp2.8.3 prior to launch, it's not working. So I've decided to just try and do it right.

Here's a page: [URL]

So, what I want to happen: On page load, the first tab: "general" and it's corresponding div beneath should be showing. And the first image should be showing. The other content divs and images should be hidden. I've given the text content divs a dashed border to show their borders. When a visitor clicks "dine at home" the general div and image hide, the second content div shows, as does the second image (it's currently the identical image, but the client may change later.) Etc.

I'll be using this function on a few other pages as well.

how to adjust this javascript to work on two different IDs at once?

current code:

<script type="text/javascript" charset="utf-8">
$(function () {
var tabContainers = $('div.imgswap > div');


View 2 Replies View Related

Why My Output Is Not On Separate Lines

Jun 8, 2011

I wonder why I am not getting desired output.

expected output:

Actual output in IE8 is Amended Completed Matured

View 4 Replies View Related

Separate A Text String Such That It Would Appear On Separate Lines

Sep 23, 2011

How would I seperate a text string such that it would appear on seperate lines ie. Initial Input: StrMsg = "This is an example of a string that will appear on seperate lines" "Hoping that this fully works, there will be no errors and all will be well" "This is the last line of text."


View 11 Replies View Related

Output From Search Function To Display On Separate Page?

Mar 15, 2010

outputting the results from a javascript search function onto a new page. Right now I am using a javascript search script on 7 pages and it works but the results overwrite the current page that the search was initiated from. I would like it to open a new page and print out into a specific area. Im not really proficient in js, tho I know enough to get by. since ive been grinding my gears at work trying to get this to display right. I'll post the code tomorrow morning when I get to work so you can see the function.

View 2 Replies View Related

Applying Same Effects On Separate 'same Named' Divs?

Oct 26, 2010

Basically I'm going to be loop[ing through data in my script, which will loop through a div such as:

<div class="showOne" style="position:relative;">
<div class="showOneText">


View 5 Replies View Related

Image - Text Swap In Separate Containers?

Feb 4, 2011

I know there are multiple threads on how to image swap using javascript. I am doing a portfolio with thumbnails at the bottom. When a thumbnail is clicked, it opens a large image at the top of page and then to the right of the large image, the description of the project appears. Both the large image and the text would fade in and stay until the next thumbnail is clicked. I have this for the script (someone pulled this from a site and gave to me) that works for clicking the thumbnail and the large image shows up:

var Idx = 1;
var IntervalKey;
var ChangeImage = function(){
//If the image still animating, stop it and start the new one
$("#MainImage").ImageSwitch({NewImage: $(".TnImage").eq(Idx).attr("src").replace("tn-","med-")});
//Mark which thumbnail is displaying

View 6 Replies View Related

Output Text When Text Is Entered To A Text Area?

Dec 16, 2010

As of right now I have a code that will work in IE but wont work in FireFox...go figure. Basically what I want to have happen is when you type in an area code it will provide an output in a predetermined area of the page.

For Example:
Input- 512
Output - Austin, TX

The code that I have doesn't work with firefox and I was just wondering if there was a code that would allow that to happen.

View 1 Replies View Related

Function To Load Text From Separate File And Insert It Into Page?

Jul 25, 2006

I have a text file that contains a whole bunch of data points neatly formatted (it's basically a CSV file). I need to create a quick JS function that would load the CSV file (from a URL) and display it with in a page. No parsing is needed! I just need to suck down the file and insert/display it within two div tags.

View 1 Replies View Related

Form Validation - Reference The Contents Of The Text Box In A Separate File?

Mar 4, 2011

so I have a html page with the following code included in it:


how would I reference the contents of the text box in a separate Javascript file? I have tried document.form.UserInfo.value and many, many variations and just can't get it to work. I presume it has something to do with the paragraph having the same name?

View 9 Replies View Related

How To Separate A Html Text In Order To Print Each Part In Individual Pages?

Jul 23, 2005

I am a novice/moderate html programmer and I wonder how to tell the
browser from which start point and to which end point in the text will
each page be printed.

In other words, I have a single html text that contains different
informations that are displayed alltogether in the same browser.
When I print this page, the browser should put each different subject
in a separate page and not having it all mixed up.
Is it possible? How should i do it?

View 4 Replies View Related

Form Output To A Text File

Jul 23, 2005

Can JavaScript be used to write the output from an HTML form to a text file? The scenario would be that the form has text fields and checkboxes and will only output the text fields that have data entered along with the checkboxes that the user has selected.

View 3 Replies View Related

Editing A Text String For Output?

Apr 22, 2009

Here is the string:

Jim Peterson 21 | Ed N 31 | Mary Joe 24 | jennifer baley 22

I am trying to grab all the text other than the "|" and output that to a text field (or global variable)..

How can we do this? I can't seem to find any scripts that show me exactly how to delete all those "|"...

is there a way to put "jim peterson 21" and "ed n 31", etc.. into their own variables?

View 2 Replies View Related

Storing Text From Dynamically Generated Output?

Jan 23, 2011

I have script that is dynamically generating updates on my page. The code is this:


<a id="cc_stream_info_song" target="new">Loading...</a>

The id tag links to a js script on a remote server and replaces the "loading" text with the song title of the currently playing song on my shoutcast server, and refreshes this every 60 seconds. I want to be able to grab this song title and put it in a php variable. I don't have access to the remote server, so I don't have any other way of getting the updated song title outside of this little snippet. I tried using php output buffering but all that does is grab the html I posted above, and not the javascript-generated song title.

View 1 Replies View Related

2 Level Combo Box Output Text Same Page

Oct 1, 2009

I have a 2 level combo box that are dependent on each other and what I want to happen when the "submit" button is selected is for an html text answer to be displayed on the same page below the combo boxes based off of what was selected in the second combo box. I've tried using hide/show functions with JavaScript but couldn't figure out how to link the 2 scripts together.

What I have is as follows:

View 2 Replies View Related

Receive The Output Of An Array From A Text Input?

Mar 12, 2011

I am trying to receive the output of an array from a text input here is the code that I am attempting to do but it is not displaying the output January

Here is the code example

<script type ="text/javascript">
function coms(str){


View 2 Replies View Related

Output Text After This JS Progressbar Finish Loading?

Jun 27, 2010

I'm using this progress bar from http://www.dynamicdrive.com/dynamici...rogressbar.htm and I want to be able to display some text after the bar finishes loading.

I figured out out to get it to output the text, but it loads in a new page. I want to get it to load where the bar is located. Here's how I'm placing the code ...

That shows the bar in the middle of my table, when it finishes it just opens to a new page saying hello world at the top. Is there a way to get it to spit out hello world in place of the bar, or at least in that table?

View 4 Replies View Related

List Box Output To Generate Text In Body?

Sep 24, 2010

I would like for the information selected in the list boxes to automatically build/generate text in the body of the page below the text boxes. Please see the attached image for an idea of what I mean.As more boxes are selected, the rest of the Part Number is generated.This is somewhat similar to chained list box, but instead of generating a 2nd list box, I want each list box to generate into it's own cell at the bottom of the page.

View 2 Replies View Related

Cascading / Output Dropdown With Result In Text Box

Oct 18, 2011

I am trying to create a 'document name generator' to standardise our document naming. I have created a template using cascading drop down menus, which is what I am after so far. how to output the results of my dropdown in to a text box. Idealy I would like to have the name as a string. For example, selecting Business - Projects - Test3 and typing in the date would result in a text box containing all three results "Business Projects Test3 18/10/2011"

HTML Code:
<script type="text/javascript">
//Applies cascading behavior for the specified dropdowns
function applyCascadingDropdown(sourceId, targetId) {
var source = document.getElementById(sourceId);
var target = document.getElementById(targetId);

View 3 Replies View Related

JQuery :: Change Text Color In Array Output

Jun 23, 2010

I want to change the color of the text in my array output according to certain conditions. The output looks like this:


And I would like it to look like this

View 1 Replies View Related

Custome Date Object With PHP-like Text-parsed Output

Dec 6, 2002

Well, this is acutally a couple different scripts. First is the custom date object myDate which retrieves pretty much every value that you'd need from a date and sets it as a property. If no argument is supplied, the current time and date is used. If you do supply an argument, you can send an existing javascript Date object, or a string that is compatible with declaring a normal javascript Date object.

The 2nd part of this script is the method getDate (and some accompanying String methods) that allow you to retrieve the date as a string by passing it a format string just like the PHP date() (http://www.php.net/manual/en/function.date.php) function accepts. The code posted below includes sufficient (I think) examples to help you understand what is going on. You will notice that I didn't duplicate EVERY code over from PHP, and a few are slightly different. Those that I left out I felt weren't very necessary, or I didn't feel like doing the algorithm for them :D.

Both myDateObj.getDate() and PHP's date() allow you to include text into the string that you don't want parsed, but each handles it differently. In PHP, you need to escape characters normally with a backslash. For getDate you need to proceed each character with a pipe "|". So, instead of$dateStr = date("Day z");as it would be in PHP, you would usevar d = new myDate();
var dateStr = d.getDate("D|a|y| z");There are more examples of how this works below.

Note: There is also a nice arrayReplace() method for strings that is handy for doing multiple replace() operations all at once, so I guess this is really like 3 handy scripts ;)

<meta http-equiv="expires" content="0">
<script type="text/javascript">

/*** First Part of Script, the custom date object ***/

function myDate(dateStr) {
if (typeof dateStr != 'undefined') {
var d = new Date(dateStr);
this.dateString = dateStr;
else if (typeof dateStr == 'object')
var d = dateStr;
var d = new Date();
var months = ['January','February','March','April','May','June','July','August','September','October','November',' December'];
var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
var monthDays = [31,28,31,30,31,30,31,31,30,31,30,31];

this.epoch = d.getTime();
this.epochS = Math.round(this.epoch / 1000);
this.year4 = d.getFullYear();
this.year2 = parseInt(this.year4.toString().substring(2));
this.leap = (this.year4 % 400 == 0) ? true : (this.year4 % 4 == 0 && this.year4 % 100 != 0) ? true : false;
if (this.leap) monthDays[1]++;
this.mnth = d.getMonth();
this.month = this.mnth + 1;
this.month_2 = leadingZero(this.month);
this.monthName = months[this.mnth];
this.monthNameShort = this.monthName.substring(0,3);
this.days = monthDays[this.mnth];
this.dy = d.getDay();
this.day = this.dy + 1;
this.dayName = weekDays[this.dy];
this.dayNameShort = this.dayName.substring(0,3);
this.date = d.getDate();
this.date_2 = leadingZero(this.date);
this.suffix = (this.date % 10 == 1 ) ? "st" : (this.date % 10 == 2) ? "nd" : (this.date % 10 == 3) ? "rd" : "th";
this.hours24 = d.getHours();
this.hours24_2 = leadingZero(this.hours24)
this.hours12 = (this.hours24 == 0) ? 12 : (this.hours24 > 12) ? this.hours24-12 : this.hours24;
this.hours12_2 = leadingZero(this.hours12);
this.minutes = d.getMinutes();
this.minutes_2 = leadingZero(this.minutes);
this.seconds = d.getSeconds();
this.seconds_2 = leadingZero(this.seconds);
this.millis = d.getMilliseconds();
this.ampm = (this.hours24 == 0) ? "am" : (this.hours24 >= 12) ? "pm" : "am";
this.GMTstring = d.toGMTString();
this.offset = d.getTimezoneOffset();

function leadingZero(num) {
return (num < 10) ? "0" + num : num.toString();

myDate.prototype.getDayOfYear = function() {
var total = 0;
var monthDays = [31,28,31,30,31,30,31,31,30,31,30,31];
if (this.leap) monthDays[1]++;
for (var i=0; i<this.mnth; total += monthDays[i++]) {}
total += this.date;
return total;

/*** Second part of script, the PHP-like parsed output ***/

myDate.prototype.getDate = function(str) {
var p = ['a','A','B','d','D','F','g','G','h','H','i','I','j','l','L','m','M','n','O','r','s','S','t','T','U', 'w','W','Y','y','z','Z'];
var r = new Array();
var i = 0;
var delChar = "|";
var sNull = "null".delimit(delChar)
r[i++] = this.ampm.delimit(delChar);
r[i++] = this.ampm.toUpperCase().delimit(delChar);
r[i++] = sNull;
r[i++] = this.date_2;
r[i++] = this.dayNameShort.delimit(delChar);
r[i++] = this.monthName.delimit(delChar);
r[i++] = this.hours12;
r[i++] = this.hours24;
r[i++] = this.hours12_2;
r[i++] = this.hours24_2;
r[i++] = this.minutes_2;
r[i++] = sNull;
r[i++] = this.date;
r[i++] = this.dayName.delimit(delChar);
r[i++] = (this.leap)?1:0;
r[i++] = this.month_2;
r[i++] = this.monthNameShort.delimit(delChar);
r[i++] = this.month;
r[i++] = this.offset;
r[i++] = this.GMTstring.delimit(delChar);
r[i++] = this.seconds_2;
r[i++] = this.suffix.delimit(delChar);
r[i++] = this.days;
r[i++] = sNull;
r[i++] = this.epochS;
r[i++] = this.dy;
r[i++] = sNull;
r[i++] = this.year4;
r[i++] = this.year2;
r[i++] = this.getDayOfYear();
r[i++] = sNull;
for (i=0; i<p.length; i++)
p[i] = "/" + p[i] + "(?!|)/g";
return str.arrayReplace(p, r).replace(/|/g,"");

String.prototype.arrayReplace = function(arrP, arrR) {
var p, s = this;
for (var i=0; i<arrP.length; i++) {
var flags = arrP[i].substring(arrP[i].lastIndexOf("/")+1);
var regex = arrP[i].substring(1,arrP[i].lastIndexOf("/"));
p = new RegExp(regex, flags);
s = s.replace(p, arrR[i]);
return s;

String.prototype.delimit = function(char) {
var s = "";
for (var i=0; i<this.length; i++) {
s += this.charAt(i) + char;
return s;



<script type="text/javascript">

/*** Example using current date/time ***/

var md1 = new myDate();
document.write(md1.getDate("l jS of F Y h:i:s A")+"<br>");
document.write(md1.getDate("T|o|d|a|y| i|s| m.d.y")+"<br>");
document.write(md1.getDate("D M j G:i:s Y")+"<br>");
document.write("It " + (md1.leap?"is":"is not") + " a leap year<br>");
document.write("The unix epoch occurred " + md1.epochS + " seconds ago");

/*** Example using javascript Date object as argument ***/

var d1 = new Date(2000, 01, 02, 15, 15, 15);
var md2 = new myDate(d1);
document.write(md2.getDate("l jS of F Y h:i:s A")+"<br>");
document.write(md2.getDate("T|o|d|a|y| i|s| m.d.y")+"<br>");
document.write(md2.getDate("D M j G:i:s Y")+"<br>");
document.write("It " + (md2.leap?"is":"is not") + " a leap year<br>");
document.write("The unix epoch occurred " + md2.epochS + " seconds ago");

/*** Example using Date object compatible string as argument ***/

var md3 = new myDate("December 10, 1978 12:23:00");
document.write(md3.getDate("l jS of F Y h:i:s A")+"<br>");
document.write(md3.getDate("T|o|d|a|y| i|s| m.d.y")+"<br>");
document.write(md3.getDate("D M j G:i:s Y")+"<br>");
document.write("It " + (md3.leap?"is":"is not") + " a leap year<br>");
document.write("The unix epoch occurred " + md3.epochS + " seconds ago");

View 4 Replies View Related

Unable To Output Text Of Array To A Specific Div / Enable This?

Nov 9, 2009

I've managed to output the text of my two arrays to a specific div (in this case the div's id is ''number') - BUT I'm only seeing the last data from each array (it's a train number and a train name) so instead of getting the entire list from 800 to 870 and the associated names I'm just getting the last pairing which in his case is 870 Zulu.

<script type="text/javascript">

this is my code. Can anyone see where I'm going wrong? code...

View 9 Replies View Related

Read An Integer And Determines And Output XHTML Text That Displays Whether It It Odd Or Even

Sep 25, 2009

I just started a programming class and stuck in a section of my assigment. Last instruction: "Write a script that reads an integer and determines and output XHTML text that displays whether it it odd or even.{hint: use the remainder operator. An even numder is a muiple of 2. Any multiple of 2 leaves a remainder of zero when divided by 2.}

View 1 Replies View Related

Read Text File Line By Line And Separate Special Characters?

May 25, 2010

how to read a text file using javascript line by line and separate from special characters in it. for example

Text.txt has

001203=Line one=abc.html
024353=Line two=xyz.html
092434=Line three=hjf.html

i want each column in an array like { 001203,024353,092434 } so total 3 arrays.

View 14 Replies View Related

JQuery :: Animate (fadein) Text Output Inside An Input Field?

May 9, 2011

I have an input field where the user will type in their name and a number, and this is then output (in real time) in another 2 input fields as they type them.

I am trying to animate the output text, so when the user types in their name, the letters fadeIn (quickly so it seems like they're flashing in) rather than just appearing.

The code I have for this at the moment is as follows (the bits in bold is what I would like to animate).


View 4 Replies View Related

Add Values Of Drop Down Menu Options And Output A Total To A Text Field

Apr 29, 2009

I have two drop down menus. I want two values to be added based on what they picked and then outputted to a text field to show a grand total in a dollar amount.

This is what I have:



Note I haven't did any type of code for the 2nd drop down menu just in case anybody says I don't see anything. I was working on trying to get started in the right direction.

View 1 Replies View Related

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