Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Help with form

Not sure if this is the correct area as it is html embedded into a perl script.

Anyway, I have this form in my page:

<table cellpadding="1" cellspacing="1" width="100%" class="border">
<tr>
<form action="$surl\" name="newonly" method="POST">
<td align="left" style="padding: 5px" class="catbg"><span class="smalltext">Your current settings are: $current - Choose how you would like to view posts</span>&nbsp;<select name="newonly"><option value="">Select Post View</option><option value="unread">View Unread</option><option value="all">View All</option</select> <input type="submit" class="button" value="Select">
</td>
</form>
</tr>
</table>


Everything works OK and the user file is updated etc etc but I have to click the Select button twice.

Does anyone know a way around this.

Many Thank's

Martin
0
hatap
Asked:
hatap
1 Solution
 
Ryan ChongCommented:
>>Everything works OK and the user file is updated etc etc but I have to click the Select button twice.
I think you mean select the drop down option and click the Select button need 2 actions? So if you want to make the changes once the user changed their drop down option, you may try like this:

<table cellpadding="1" cellspacing="1" width="100%" class="border">
<tr>
<form action="$surl\" name="newonly" method="POST">
<td align="left" style="padding: 5px" class="catbg"><span class="smalltext">Your current settings are: $current - Choose how you would like to view posts</span>&nbsp;<select name="newonly" onChange="document.forms[0].submit();"><option value="">Select Post View</option><option value="unread">View Unread</option><option value="all">View All</option</select> <input type="submit" class="button" value="Select">
</td>
</form>
</tr>
</table>

?
0
 
hatapAuthor Commented:
Worked like a charm ryancys, thanx very much.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now