Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old November 28th, 2007, 12:55 PM   #1
New Member
 

Join Date: Jun 2006
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 simbo1231 is on a distinguished road
Question Repeat data entered in a text box... and maybe change it?

Hi everyone,

I have 3 upload boxes on my website for images (small, medium and large), lets call them box 1, box 2 and box 3. When I press a button next to each, I can find the image that I'd like to upload, and then it puts the path into the text box for me, so that I can change it if I want.

To save A LOT of time (there are loads of images in the folders, so it takes ages to load the window), I would like the path that is in box 1, to be repeated in boxes 2 and 3.

Now here's the more difficult part, that I'm not sure can even be done! The folders that the images are in are named s, m and l. If I choose the image in box 1 (from the folder s), when the path is repeated in the other boxes, is there anyway to automatically change the s, to m and l.

If the second point can't be done then no worries, any help at all with the first would be greatly appreciated.

Many thanks in advance
simbo1231 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 29th, 2007, 08:17 AM   #2
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 954
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: Repeat data entered in a text box... and maybe change it?

This isn't really a possibility due to javascript not having access to files on a user's machine, this would pose quite a security risk.
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 29th, 2007, 03:08 PM   #3
New Member
 

Join Date: Jun 2006
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 simbo1231 is on a distinguished road
Re: Repeat data entered in a text box... and maybe change it?

Thanks for your reply, but I think I must have made it unclear.

The text boxes don't need to have any access to files, all I want it to do is to repeat the text that is entered into box 1, into boxes 2 and 3.

I've seen scripts to do this before, but only when a checkbox is selected. I'd like to do it when the text is changed, and to repeat the value from 1 box, in to 2 others.

Many thanks,
Simon
simbo1231 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 29th, 2007, 10:36 PM   #4
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 954
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: Repeat data entered in a text box... and maybe change it?

Okay, I get what you're saying but you are talking about <input type="file">'s right?

You click on browse or find and it opens a window to select a file then once selected the path to the file goes into the text box. Javascript can't change this value because if you could do that with javascript, then the file at that path can then be sent to the server so a malicious coder could ask for c:\passwords.txt and that file would be sent to the website without the user knowing.

You can change the values of text boxes easily enough but not file inputs.

Code:
<script type="text/javascript">

function changeTexts(value) {
var inputBoxes = document.getElementByTagName(''input');

for (i = 0; i< inputBoxes.length; i++){
if (inputBoxes[i].type == 'text') {
     inputBoxes[i].value = value;
}
}
}
</script>

<input type="text" value="" name="hi" onchange="changeTexts(this.value)"/>
<input type="text" value="" name= "hi1" />
<input type="text" value="" name="hi3" />
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 2nd, 2007, 06:24 AM   #5
New Member
 

Join Date: Jun 2006
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 simbo1231 is on a distinguished road
Re: Repeat data entered in a text box... and maybe change it?

Okay I'll give that a go, thanks for your help.
simbo1231 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change descriptive Google Text Jack Franklin Search Engine Optimization (SEO) 17 December 24th, 2007 10:15 AM
change colour of text, on hover. Jason3107 HTML, XHTML and CSS 28 September 27th, 2007 07:10 PM
background-repeat: repeat y not working properly AdRock HTML, XHTML and CSS 12 February 25th, 2007 06:17 PM
change text underline colour help Aaron1988 HTML, XHTML and CSS 6 August 30th, 2006 03:18 PM
Returning results into a table with no repeat of data lobster1983 PHP 7 September 24th, 2005 04:23 PM


Search Engine Optimization by vBSEO 3.2.0 RC8