Jump to content

giving absurd results.


Recommended Posts

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.

Link to comment
Share on other sites

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


<input name=newtopic type='text' size='50'>

<input name=category type='text' size='50'>

<input name="main" type="checkbox" id="main" value="y" />


// 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.



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.