Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Form Woes

Reply
Thread Tools

Form Woes

 
 
Leon
Guest
Posts: n/a
 
      02-13-2007
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>

Thanks,

Leon
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-13-2007
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
 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      02-14-2007
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>


Wouldn't it be easier and clearer for your users if you skipped the form
and just had a link for each action?
 
Reply With Quote
 
=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=
Guest
Posts: n/a
 
      02-14-2007
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-Se
> nd Activation Email <option value="deletaccount"
> onclick="this.form.action.value='./admin_process.php?a=delete';">Delet
> e This Account </select> <input class="formBox" type="submit"
> name="submit" value="Go"> </form>


Why would you do it this way when you can simply do it like this:

<form action="./admin_process.php" method="post">
<select name="a" class="formBox">
<option value="">Select Action From List
<option value="resend">Re-Send Activation Email
<option value="delete">Delete This Account
</select>
<input class="formBox" type="submit" name="submit" value="Go">
</form>

--
Kim André Akerĝ
- http://www.velocityreviews.com/forums/(E-Mail Removed)
(remove NOSPAM to contact me directly)
 
Reply With Quote
 
Rik
Guest
Posts: n/a
 
      02-14-2007
On Wed, 14 Feb 2007 19:56:23 +0100, Kim André Akerĝ
<(E-Mail Removed)> wrote:

> 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-Se
>> nd Activation Email <option value="deletaccount"
>> onclick="this.form.action.value='./admin_process.php?a=delete';">Delet
>> e This Account </select> <input class="formBox" type="submit"
>> name="submit" value="Go"> </form>

>
> Why would you do it this way when you can simply do it like this:
>
> <form action="./admin_process.php" method="post">


Euhm, GET?

> <select name="a" class="formBox">
> <option value="">Select Action From List
> <option value="resend">Re-Send Activation Email
> <option value="delete">Delete This Account
> </select>
> <input class="formBox" type="submit" name="submit" value="Go">
> </form>


A whole lot simpler indeed. I'd prefer buttons though:
<form action="./admin_process.php" method="get">
<input type="submit" name="a" value="resend">
<input type="submit" name="a" value="delete">
</form>

Allthough it's a pity the text on the button and the actual value cannot
differ, but that's either pretty quickly solved server-side.
--
Rik Wasmus
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
<form>...</form> - how to supress blank space after </form> in IE? rob c Javascript 4 12-30-2005 06:10 PM
Smiley Click picker using Javascript and FORM woes .. Please help... descds Javascript 3 09-16-2004 06:30 AM
adhoc network 11g wireless dropout woes dkh Wireless Networking 1 08-02-2004 01:27 PM
MN-700 and HP Pavilion woes shasha Wireless Networking 0 07-31-2004 10:12 AM



Advertisments