Help needed with a simple form code , change it to a button..

Started on the old forum in June 2013 · view the original in the archive · old links redirect here

1 reply · 374 views · started 13 years ago · 1 min read

2 participants
shijilt1234 Junior · 10 posts #1

I want help in the following code. I wanna chnage the following script into a single button , which sends the vale "5".

print '<form action="file.php?file='.$file.'&sort='.$sort.'&p='.$p.'" method="post">
<div>
<select name="rating">
<option value="5">5</option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
<option value="1">1</option>
</select><br/>
<input type="submit" value="Rate"/>
</div>
</form>';

I don't want the dropdown menu , just want a single rate button , which will post vale "5" only. Thanks in advance.

arnage Lead · 811 posts #2
print '<form action="file.php?file='.$file.'&sort='.$sort.'&p='.$p.'" method="post"> 
<div> 
<input type="hidden" name="rating" value="5"/><br/>
<input type="submit" value="Rate"/> 
</div> 
</form>';

// Or:

print '<form action="file.php?file='.$file.'&sort='.$sort.'&p='.$p.'" method="post"> 
<div> 
<input type="text" name="rating" value="5"/><br/>
<input type="submit" value="Rate"/> 
</div> 
</form>';

// Or:

print '<form action="file.php?file='.$file.'&sort='.$sort.'&p='.$p.'" method="post"> 
<div> 
<input type="radio" name="rating" value="5"/>5<br/>
<input type="submit" value="Rate"/> 
</div> 
</form>';
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close