CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Submit buttons and radio fields

 



Dreamer
Deleted

Feb 16, 2000, 4:49 AM

Post #1 of 3 (779 views)
Submit buttons and radio fields Can't Post

I have a question. Does anyone know if there is any way to make a submit button equal to a variable? I needed to redirect a few of my pages (advance them a little) and to do that I had to create different submit buttons. The only problem with that is there are yes and no answers, and a different $$ amount depending on which one is chosen. So on those pages there are two submit (redirect) buttons (one for yes and one for no), but I need to have each of them have their own monetary value.

Here is the code to try and get it to figure the price for those buttons (the program does work)that didn't give me errors, but it didn't carry the value with it.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


sub domain {
submit(-name=>'go',-value=>'Yes') eq hidden(-name=>'domain',-value=>(param(' Yes')));

$FORM{'domain'} = (param('domain'));

}
</pre><HR></BLOCKQUOTE>

Any help would be appreciated.
TIA,
Dreamer



kencl
User

Feb 21, 2000, 12:38 AM

Post #2 of 3 (779 views)
Re: Submit buttons and radio fields [In reply to] Can't Post

Include the value in the name, then get the receiving script to parse the name.

eg button1 name=goValue1
button2 name=goValue2

receiving script:

$value = substr($name, 2);
# $value will be "Value1" or "Value2"



Dreamer
Deleted

Feb 21, 2000, 1:15 AM

Post #3 of 3 (779 views)
Re: Submit buttons and radio fields [In reply to] Can't Post

Thanks kencl ... I guess I should have posted my question. Try this. Here's My code now (it does work, I'm just trying to get it to look and do it the way I want it):
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


<input type=\"radio\" name=\"domain\" value=\" a domain name\"> ";
print hidden(-name=>'name',-value=>(param('name'))),
hidden(-name=>'email',-value=>(param('email'))),
hidden(-name=>'size',-value=>(param(''))),
hidden(-name=>'type',-value=>(param(''))),
hidden(-name=>'graph',-value=>(param(''))),
submit(-name=>'go',-value=>'I Want a Domain!'),
hidden(-name=>'page',-value=>$current_page,-override=>3),;
print "<br><br> <input type=\"radio\" name=\"domain\" value=\" no domain name\"> ";
print submit(-name=>'go',-value=>'No domain wanted'),
end_form;
</pre><HR></BLOCKQUOTE>

What it want it to do is to do this without the radio buttions.. In other words, when you click on
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


submit(-name=>'go',-value=>'I Want a Domain!'),
hidden(-name=>'page',-value=>$current_page,-override=>3),;
</pre><HR></BLOCKQUOTE>

I want it to also interpret the "domain" value as " a domain name". I had that working, but unfortunately it didn't carry the hidden domain field past the next page. If you can think of some way to do this I would appreciate it.
TIA
Dreamer

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives