GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Sep-2003, 07:58
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

text field problm


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
  #2  
Old 02-Sep-2003, 12:12
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
Wow, I am confused too. Do you think you could explain this a little bit better? It sounds like you are trying to do something with a DB.... Do you just want a text field?
  #3  
Old 03-Sep-2003, 03:01
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
thanks Bobby well i can post jscript code for u so that it will more clear for you but only problem i got is i cant delete the items which is coming from database so when i delete these items it also delete from database as im using php and msql

if you want then i can also post code for php as im having some rough idea but dont no how to fulfil it

hope this code is going to clear for u

Code:
<html> <head> <title>Add - Remove entries from a select box</title> <script> function add(sel,inp) { var oOp = document.createElement("OPTION"); oOp.text=inp.value; oOp.value=inp.value; sel.options.add(oOp) } function remselected(sel) { sel.options.remove(sel.selectedIndex) } </script> </head> <body> <form name="testform"> <select name="testsel"> <option>Days </select> <br> <input type="text" name="testinp"> <br> <input type="button" name="Add" value="Add" onClick="add(document.all.testform.testsel,document.all.testform.testinp)"> <input type="button" name="Remove" value="Remove" onClick="remselected(document.all.testform.testsel)"> </form> </body> </html>

thnaks in advance
  #4  
Old 04-Sep-2003, 06:18
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

Re: text field problm


may be this is more clear for anybody who looks at this post

thanks for ur sincere advice and support for this post it alomost solved but when i add second field name uvorganag then it causing trouble when i enter any value in this field then its adding in drop down as well as adding empty space in first and second drop down,a wierd result
plz have a look for more clear what im trying to covince

server2.vitodesign.com

if anybody help me out in this matter will be very helpful to mr as djerratik is in holiday till friday and im not coming tomorrow
only on monday

thanks in advance

Code:
<? include("../settings.php"); /* Connecting, selecting database */ $link = mysql_connect("$dbhost", "$dbuser", "$dbpw") or die("Could not connect"); mysql_select_db("$dbuser") or die("Could not select database"); if (isset($HTTP_POST_VARS['hadd'])){ mysql_query("INSERT into emp_details SET hvorgang = '".$HTTP_POST_VARS['newhvorgang']."'"); echo "added: ".$HTTP_POST_VARS['newhvorgang'].""; } if (isset($HTTP_POST_VARS["hremove"])){ mysql_query("DELETE from emp_details WHERE hvorgang = '".$HTTP_POST_VARS['hvorgang']."'"); } /***if i remove these code then it works fine for h vorgang***/ if (isset($HTTP_POST_VARS['uadd'])){ mysql_query("INSERT into emp_details SET uvorgang = '".$HTTP_POST_VARS['newuvorgang']."'"); echo "added: ".$HTTP_POST_VARS['newuvorgang'].""; } if (isset($HTTP_POST_VARS["uremove"])){ mysql_query("DELETE from emp_details WHERE uvorgang = '".$HTTP_POST_VARS['uvorgang']."'"); } /*** **************************************************** ***/ $query = "SELECT hvorgang,uvorgang FROM emp_details "; $result = mysql_query($query) or die("Query failed: $query"); $getrow= mysql_fetch_array($result); $hvorgang = array(); $uvorgang = array(); while ($row = mysql_fetch_assoc($result)) { array_push($hvorgang, $row["hvorgang"]); array_push($uvorgang, $row["uvorgang"]); } $haupt = array_unique($hvorgang); $unter = array_unique($uvorgang); ?> <html> <head> <title>Beschreibung</title> <link rel="stylesheet" type="text/css" href="../styles/styles1.css" /> <script language="JavaScript" src="../JS/editdropdown.js"></SCRIPT> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#666666"> <? ?> <body> <form name="theForm" action="" method="post"> <TR bordercolor="#FF6600"> <TD nowrap>Enter Option Name: <input type="text" name="newhvorgang"> <select name="hvorgang"> <option value="">Option List</option> <? foreach($haupt as $value) { ?> <option value="<?= $value ?>" <? if ($HTTP_POST_VARS['hvorgang'] == $value){ echo "SELECTED";}?>><?= $value ?></option> <? } ?> </select> <br> <input type="submit" value="Add Item" name="hadd"> <input type="submit" value="Remove Item" name="hremove"> </TD> </TR> <br><br> <!--if i remove this table uvorgang then it works normal for above table --> <TR bordercolor="#FF6600"> <TD nowrap>Enter Option Name: <input type="text" name="newuvorgang"> <select name="uvorgang"> <option value="">Option List</option> <? foreach($unter as $value) { ?> <option value="<?= $value ?>" <? if ($HTTP_POST_VARS['uvorgang'] == $value){ echo "SELECTED";}?>><?= $value ?></option> <? } ?> </select> <br> <input type="submit" value="Add Item" name="uadd"> <input type="submit" value="Remove Item" name="uremove"> </TD> </TR> </form> </body> </html>
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD Burner Help - Power Calibration Error.... JonBoy420 Computer Hardware Forum 111 19-Feb-2009 04:54
Manipulating text Files k209310 C++ Forum 0 17-Nov-2003 11:23
CD Buring Failed skanth2000 Computer Hardware Forum 1 15-Nov-2003 04:52
Placing Flash/Images/Grapics inside TEXT with DHTML CSS Style Filteres 000 Web Design Forum 1 24-May-2003 12:25
Scrolling Text Ads - Free advertising on other peoples sites jrobbio Advertising & Affiliates Forum 0 19-Feb-2003 01:00

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:31.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.