sandhya Posted September 30, 2008 Share Posted September 30, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/126405-giving-absurd-results/ Share on other sites More sharing options...
sandhya Posted September 30, 2008 Author Share Posted September 30, 2008 plzz help me Quote Link to comment https://forums.phpfreaks.com/topic/126405-giving-absurd-results/#findComment-653691 Share on other sites More sharing options...
Jibberish Posted September 30, 2008 Share Posted September 30, 2008 Post the form code and the php code so we can get a clearer meaning of whats going on. Quote Link to comment https://forums.phpfreaks.com/topic/126405-giving-absurd-results/#findComment-653703 Share on other sites More sharing options...
sandhya Posted September 30, 2008 Author Share Posted September 30, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/126405-giving-absurd-results/#findComment-653741 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.