You are here: Re: Form with 2 submit buttons... « HTML « IT news, forums, messages
Re: Form with 2 submit buttons...

Posted by Jonathan N. Little on 08/07/06 17:54

Sonnich wrote:
> ZeldorBlat wrote:
>> Sonnich wrote:
>>> Hi all!
>>>
>>> I have a file where I'd have to submit buttons, and I need to differ
>>> between those.
>>>
>>> Step #1 - open html win with default selection
>>>
>>> Step #2 - user may select some criteries for the list
>>> Step 2 might be repeated, or not used at all. There is a button "apply
>>> selection"
>>>
>>> Step #3 - user selects a number of files/items, which are then handled.
>>> There is a button for that.
>>> Done.
>>>
>>> The point is, that I need both the critearies for the SQL selection in
>>> step 2, but also the selected files (list) in step 3. Actually the
>>> selection for step 2 are needed for step 3 only.
>>>
>>> Any good ideas on how I might have 2 buttons with submits data?
>>>
>>> BR
>>> Sonnich
>> Not entirely sure what you're trying to do, but if you want two submit
>> buttons just give them different names:
>>
>> <input type="submit" name="foo" value="First Button"/>
>> <input type="submit" name="bar" value="Second Button"/>
>>
>> And on the target page:
>>
>> if(isset($_REQUEST['foo'])) {
>> //first button was used
>> }
>> else if(isset($_REQUEST['bar'])) {
>> //second button was used
>> }
>
> That was exactly what I needed.
>
> I found that it should work here too:
>
> if( !(isset($_POST[$part1[$i]]) && ($_POST[$part1[$i]] ==
> "")) )
> echo " checked";
> else
> echo "";
>
> Idea: checkbox is default checked, but only if set and set to nothing
> it is not set.
> Boolean algebra. Only if set, and set to nothing, then it is not set.
>
> But by some reason it does not work. I have done this a 147533 times,
> and here it does not work. Why?
>
I think a misplaced closing parentheses:

if( !(isset($_POST[$part1[$i]])) && ($_POST[$part1[$i]] =="") ){
echo " checked";
}
else {
echo "";
}

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация