hi,
i got problem regarding text field,actually i need text field for admin page so that i can add as many values
for eg. let say user chris geting project every week so that from admin page i can give project name so that when chris logins he will get the project list as drop down
first i thought to make 8 text fields so that when i input some value he will get these values in his form,but then database problem as i can give only one name in text field otherwise database will mess up
so anybody knows some script so that a text field is there and 2 buttons ADD and DELETE so when i enter some value and click on ADD it will add the items and more i click on add it will be shown the list added items and wheni select and click on delete then it will deleted
this will be helpful for me so that when i go to admin page then the added values i can retieve from database and no worry to be data get lost otherwsie when i refresh the data will gone
im totally confused what to do if anybody have any other idea about this it will be appreciable
thanks in advance
text field problm
Moderator: General Moderators
- Vincent Puglia
- Forum Commoner
- Posts: 67
- Joined: Thu Sep 04, 2003 4:20 pm
- Location: where the World once stood
Hi,
I also am a little confused. However, you can output 8 text fields with the same name.
They should appear as follows:
<input type="text" name="somename[]" value="<? =$phpVar ?>">
You simply have to access them as follows:
var formObj = document.formname;
for (var i = 0; i < formObj.length; i++)
{
var fldObj = formObj.elements;
if ( fldObj.name == "somename[]")
{
someVar = fldObj.value;
}
}
Vinny
I also am a little confused. However, you can output 8 text fields with the same name.
They should appear as follows:
<input type="text" name="somename[]" value="<? =$phpVar ?>">
You simply have to access them as follows:
var formObj = document.formname;
for (var i = 0; i < formObj.length; i++)
{
var fldObj = formObj.elements;
if ( fldObj.name == "somename[]")
{
someVar = fldObj.value;
}
}
Vinny