
sandhya
Members-
Posts
65 -
Joined
-
Last visited
Everything posted by sandhya
-
hi all,i think my post may not completely related this type.but i'm trying to do this in javascript except data collection from the database. is it possible? if yes how? and my problem is here. i have a form that displays main categories from database in a drop down list. after selecting a category a drop down list should be generated with the sub categories of the selected category. these sub categories also may have the sub-subcategories. if exists, another drop down list should be generated with the sub-subcategories of the selected subcategory. this process should continue till any selected sub category has no sub-subcategories. how can i do it. i'm developing this form using php and javascript. i"ll be thankfull to whom can give me the solution.
-
please tell me what is happening there and how to solve it.
-
hi all, i'm confused with this. i'm developing a form by getting data from mysql database. i have two list/menu fields. first field displays the main categories from the database. and the second one displays the subcategories of the selected category from first menu. up this every thing is fine. after selecting the category wrote a function to submit the form. and after reloading the category should be selected automatically from the following code written after while loop. <? if($_POST['cat']!="") { ?> <script language="javascript"> var catg=<? echo $_POST['cat'] ?>; var i; for(i=1;i<=document.form1.cat.options.length;i++) { if(document.form1.cat.options.value==catg) { document.form1.cat.options.selected=true; } } </script> <? } ?> it was working nice for this. but after selecting subcategory also submitting the form and after reloading subcategory field also should be selected automatically same as the category field.but here some problem is arising. it selects the default field from the list.i wrote similar code as for first one. i'm giving the second one's code also. <? if($_POST[subcat]!="") { echo "subcat=".$_POST[subcat]; ?> <script language="javascript"> var subcatg=<? echo $_POST[subcat] ?>; for(i=1;i<=document.form1.subcat.options.length;i++) { if(document.form1.subcat.options.value==subcatg ) { document.form1.subcat.options.selected=true; } } </script> <? } ?> please anyone help me. thanks in advance.
-
thanks but it was solved a little bit. but here is some more.i have a check box given value 'y' when checked. but it was taking 'y' every time means either it is checked or not.to give you the clearence i'm giving you the short form of the code. the form code is here follows............. <form name=form1> <select name='topic'> <option value=''>SELECT TOPIC</option> //here i have displayed the topics from database using while loop.they were displayed correctly </select> <input name=newtopic type='text' size='50'> <input name=category type='text' size='50'> <input name="main" type="checkbox" id="main" value="y" /> </form> // and on submit form was validated so that when ever the 'category' is not given and 'main' was selected then 'topic' or 'newtopic' should not be selected .and there i gave an alert. due to main value displying 'y' all the time, it was giving alert even when the category is also given.this is the problem.
-
hi all, i'm confused with this. i have a form with topic menu and newtopic text box. after submitting the form i'm checking the variables to execute the following code. there the value $topic(means selected list value) is not selected means default value 'select' was there. i'm checking weather $topic!='select', there it was giving true. and entering into the executing code. it was giving true each time though it was selected or not. what could be the problem. please anyone give me the reason. thanks in advance.
-
hi, thanks but problem is not with database. that is mainly to print a bill. The bill format i set is not printing.I'm getting very small text and full print of A4 size paper. I mean after printing the table i created for the bill format, blank paper is coming out from the printer up to the A4 size paper. I want the print of the bill like after printing the bill, printer should stop printing. How can i do it. Is it the problem of coding or are there any settings for printing. please help me.
-
please any one help me. Is it possible or not.Atleast let me know this. if anybody know the solution please help me.
-
Hi all, I'm working with an online billing project. I did all the coding very well but, a problem is arising with the printing bill. I'm working in php, java script. while i was giving print() at the end of the form, it was printing the full A4 size and with very small text. How can i overcome this problem. And i want a print of particular table or division. How can i do it. I"ll be very thankful to u who can give me the solution.
-
Hi to all, I have a problem with onchange event. Can anybody tell me is it possible to insert a textfield after using the onchange or onblur events while checking the conditions.For exaple, I have a dropdown list and after selecting one field and on change I have to display a textfield in which I can enter the regarding values of the selected field.How can I do it. Anybody Please Help me. Thanks
-
Facing problem with changing the display amount on change
sandhya replied to sandhya's topic in PHP Coding Help
Thanks, but I con't use the text box here for total(i mean netamount) . And already calculated the items total value and assaigned to the variable $total. using this variable i've to do it. At first the netamount should be displayed and on changing the discount value, the netamount should be refreshed eveytime. -
Hi all, I have a billing form. I managed to display the total amount by collecting and calculating the values from database. Now I have a text box named discount on the side of amount display. Now I have to subtact the enterd discount from total amount and display the total amount on change. How can i do it now. Anybody help me.
-
Passing the selected value form a dropdown list from a database
sandhya replied to sandhya's topic in PHP Coding Help
thanks. its worked. -
Passing the selected value form a dropdown list from a database
sandhya replied to sandhya's topic in PHP Coding Help
ya i'm giving the code i used here. <select name="empid" > <option value="" selected>Select Empolyee ID</option> <?php while ($recs = mysql_fetch_array($empids)){ $id = $recs['id']; ?> <option value="<? $id ?>"> <? echo $id; ?></option> <? } // end while ?> </select> on submitting this form the value passed is the last row of the selection evry time.