|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Option value
Hello, i have an option field which has two values in it.ClassA and ClassB.By default it shows ClassA and when i select ClassB, the value is stored in the db and it is shown after i submit it.
I have set option value=0 for classA and 1 for ClassB.Now, when i select Class B and save it, it still shows ClassA but in the db it shows1. since in the db, it is stored as 1, i want ClassB to be displayed in my form.How can i fix this one.Hope some body would help me. Thank you ------------others.ini--------------- <? if ($frm_save == 1) { $sql = "update TBL1 SET ARICLASS = '$ariclass'"; $result = ibase_query($connection, $sql); } $db = 'Select ARICLASS from TBL1'; $bsc = ibase_query($connection, $db); while ($row = ibase_fetch_object($bsc)) ?> <SELECT size=1 name=ariclass> <OPTION value="0"<?php if ($row->MOB_ARICLASS==0) { echo ' selected="selected"'; }?>>ARI CLASSA</OPTION> <OPTION value="1"<?php if ($row->MOB_ARICLASS==1) { echo ' selected="selected"'; }?>>ARI CLASSB</OPTION> </SELECT> ?> -------------.php.................... <?php include "dbconnection.ini"; ?> <form name="frm_main" method="post"> <?php include "others.oam"; ?> <br></b><input type="submit" name="save_button" value="Save"></br> <input type="hidden" name="frm_save" value="1"> </form> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Option value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|