Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 967 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Other Programming Languages :

Javascript question

Thread title: Javascript question
Closed Thread    
    Thread tools Search this thread Display Modes  
02-09-2007, 05:17 PM
#1
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old  Javascript question

how would i refer to this form:

Code:
<form name="quickquote">
<select name=s1></select>
<select name=s2></select>
<select name=s3></select>
<input name="output" />
</form>
ie: document.quickquote.output.value = "test"; ??

02-09-2007, 05:20 PM
#2
localhost is offline localhost
localhost's Avatar
Status: Dediport Hosting
Join date: Jul 2006
Location: Berkshire
Expertise: programming, business
Software: Dreamweaver
 
Posts: 1,316
iTrader: 17 / 100%
 

localhost is on a distinguished road

  Old

Could you please tell us what you mean, I don't get this post?

02-09-2007, 06:33 PM
#3
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

say if i wanted a script to change the value of the input named output how would i do it:

<script language="javascript">
document.quickquote.output.value = "test";
</script>

02-09-2007, 07:19 PM
#4
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Code:
var eForm = document.getElementsByName("quickquote")[0];
var eOutput = eForm.getElementsByTagName("input")[0];
eOutput.value = "test";

02-09-2007, 08:25 PM
#5
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

that does look like good flawless javascript but its still not working for me =/

02-09-2007, 08:29 PM
#6
Impluo is offline Impluo
Status: We're all mad here
Join date: Aug 2005
Location: Missouri
Expertise: programming
Software: Notepad
 
Posts: 1,606
iTrader: 0 / 0%
 

Impluo is on a distinguished road

  Old

Are you trying to do something like this?

Code:
<script language="javascript">
function str(value) {
document.quickquote.output.value=value
}
</script>

<form name="quickquote">
<select onchange="str(value)">
<option value="s1">Select 1</option>
<option value="s2">Select 2</option>
<option value="s3">Select 3</option>
</select>
<input name="output" />
</form>

02-09-2007, 08:29 PM
#7
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Show us your entire HTML page.

02-09-2007, 09:42 PM
#8
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

Code:
<script type="text/javascript">
var eForm = document.getElementsByName("quickquote")[0];
var eOutput = eForm.getElementsByTagName("input")[0];
eOutput.value = "test";
</script>
in the head
Code:
<div id="quotes">
				<form name="quickquote" id="quickquote">
					<select name=s1></select>
					<select name=s2></select>
					<select name=s3></select>
					<input name="output" />
				</form>
			</div>
in the body

there are no repeat ids as its valid xhtml css

02-10-2007, 11:59 AM
#9
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

right here is entire page:

www.xi0s.net, any help wud be fantastic . basically im trying to get my quick quote working,

02-17-2007, 07:41 AM
#10
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old

Ok I am going to suggest you to use innerHTML for the function... So what I suggest is...where you have a onclick or something and do this:
Code:
document.getElementById('id').innerHTML = '100$';
Since you are using an input, and that isn't really proper or needed. Where you can have a div, and use innerHTML.

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed