Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form fieds --> pfff

Status
Not open for further replies.

Bramvg

IS-IT--Management
Jan 16, 2001
135
BE
Hi ,

I have form with 3 fields on a row.
The first value should be a text box where someone can enter a value between 1 and 800. The second field is a normal text field, nothing specifiek. But the third field is again a text field (can also be a 'DIV'/...) where I need to print out some text. The text depends on the value entered in the first textbox.

For each number there is a text.

BUT: these these input type=text boxes have to be repeated on about 20 lines. Meaning: if you go to line nr. 2 again you must be able to enter a value and show the corresponding text at your right.

To make it more visible I've put this particular page online! Take a look at:
Whereas:

'Rubriek' = a text field where you must enter a number
'Bedrag' = a normal text field where people must enter a value
'Omschrijving'= here the text will be displayed according the number you entered into 'rubriek'.

Could you help me (again) on this?
Tnx


With kind regards
Bram
 
the following script will dynamically set value of the second text field based on the value form first text field:

<script>
<!--
function setOmschrijving(fieldValue) {
switch(fieldValue){
case &quot;100&quot;:
document.mainForm.Omschrijving.value = &quot;value 100&quot;;
break;
case &quot;200&quot;:
document.mainForm.Omschrijving.value = &quot;value 200&quot;;
break;
default :
document.mainForm.Omschrijving.value = &quot;other then 100 or 200&quot;;
break;
}
}
//-->
</script>
Try entering value 100 or 200 in the first text field:<br>
<form name=&quot;mainForm&quot;>
Field 1:
<input type=&quot;text&quot; name=&quot;Rubriek&quot; onblur=&quot;setOmschrijving(this.value)&quot;>
Field 2:
<input type=&quot;text&quot; name=&quot;Omschrijving&quot;>
</form> Sylvano
dsylvano@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top