|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Automatically Populating Forms for testing
How can I automatically populate form fields based on a value on the first form field???
__________________
Moojjoo |
|
#2
|
||||
|
||||
|
Can you extrapolate on what you're after - give us an example.
|
|
#3
|
|||
|
|||
|
Yes Explaining...
fillForm(){
firstName=document.consumerform.strFirstName.value ; If (firstName == 'Robert'){ document.consumerform.strLastName.value = 'Hell Yeah' } } I am trying to populate my form in so when I enter a value in for the first form field I don't have to spend time entering data for testing purposes. <input type="text" name="strFirstName" value="<%=strFirstName%>" size="25" onChange="fillForm();"> |
|
#4
|
||||
|
||||
|
For stuff like this (dev and testing) i use ASP cookies.
First, create a submission form that saves your fields to their respective cookies.. e.g. save the txt_myname field to a myname cookie. Then, insert code like this into the form, so that the cookie values are automatically inserted if they exist. <input type="text" name="txt_myname" value="<%=request.cookies("myname")%>"> |
|
#5
|
|||
|
|||
|
function keyword always helps
duh!!!
forgot the keyword function function populate(){ var firstName firstName=document.consumerform.strFirstName.value ; if (firstName == 'Robert'){ document.consumerform.strLastName.value = 'Hell Yeah' } } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Automatically Populating Forms for testing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|