You are here: Re: Form Woes « HTML « IT news, forums, messages
Re: Form Woes

Posted by Jonathan N. Little on 02/13/07 20:46

Leon wrote:
> Hi Chaps,
>
> I have been looking around the internet and I really can't see what I'm
> doing wrong here !
>
> This code works in firefox, but not internet explorer.
>
> Any suggestions please? Internet Explorer just doesnt update the action
> of the form so when you hit the button - it seemingly just refrehes the
> page!
>
> <form name="actions" action="" method="post">
> <select name="action" class="formBox">
> <option value="null" onclick="this.form.action.value='';">Select Action
> From List
> <option value="resendActEmail"
> onclick="this.form.action.value='./admin_process.php?a=resend';">Re-Send
> Activation Email
> <option value="deletaccount"
> onclick="this.form.action.value='./admin_process.php?a=delete';">Delete
> This Account
> </select>
> <input class="formBox" type="submit" name="submit" value="Go">
> </form>

No, no do not set the action with JavaScript. Looks like your want an
either or option use a radio button and set the form destination in the
ACTION attribute:

<form action="./admin_process.php" method="post">

....

<fieldset>
<legend>Account Action</legend>
<input type="hidden" name="b" value="zoom">
<input name="a" id="resendIt" type="radio" value="resend" checked>
<label for="resendIt">Re-Send Activation</label>
<input name="a" id="deleteIt" type="radio" value="delete">
<label for="deleteIt">Delete This Account</label>
<input type="submit" value="Go">
</fieldset>
</form>


Since your want POST method, not sure why you were hacking the ACTION to
add a GET query string. Now in "admin_process.php":

if(isset($_POST['a'])){
if($_POST['a']) == 'resend'){
//account resent routine
}
elseif($_POST['a']) == 'delete'){
//account delete routine
}
else {
// shouldn't happen your form's been hacked!
}
}

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

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