LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-28-2013, 05:04 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
change script


Hi All ,

I have a HTML script as below , user can select volvo , saab , opel , if I would like to add a function , if the user select Volve , then do xxxx , if the user select Saab , then do yyy , if the user select Opel , then do zzz , what can I do ? thanks

<html>
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
</select>
</html>
 
Old 06-28-2013, 05:11 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
There are numerous HTML tutorials you can find with a web search.

In this case it looks like you want a FORM and a RADIOBUTTON and have the user SUBMIT to a CGI script on the server.

That is if you're not doing it on the client in javascript.
 
Old 06-28-2013, 05:22 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by linosaurusroot View Post
There are numerous HTML tutorials you can find with a web search.

In this case it looks like you want a FORM and a RADIOBUTTON and have the user SUBMIT to a CGI script on the server.

That is if you're not doing it on the client in javascript.

Sorry , I am not familiar with jsp , would you advise how to do it ?
thanks
 
Old 06-28-2013, 05:37 AM   #4
litzel
Member
 
Registered: May 2013
Location: Athens, Greece
Distribution: Xubuntu 12.04, Linux Mint 13
Posts: 80

Rep: Reputation: 5
Hi, you can find a couple of tutorials in making forms in HTML in w3schools.com website. They also have a section there where you can see a couple of stuff regarding javascript.

If I get right what you want to do though, something like this comes to mind:

<form>
<input type="checkbox" name="car" value="volvo">Volvo<br>
<input type="checkbox" name="car" value="saab">Saab<br>
<input type="checkbox" name="car" value="opel">Opel<br>
<input type="submit" value="Submit">
</form>

If checkboxes are not what you were after, you can try type="radio" to get radio buttons instead.


Hope it helps you out^^

Last edited by litzel; 06-28-2013 at 05:56 AM.
 
Old 06-28-2013, 08:39 AM   #5
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by litzel View Post
Hi, you can find a couple of tutorials in making forms in HTML in w3schools.com website. They also have a section there where you can see a couple of stuff regarding javascript.

If I get right what you want to do though, something like this comes to mind:

<form>
<input type="checkbox" name="car" value="volvo">Volvo<br>
<input type="checkbox" name="car" value="saab">Saab<br>
<input type="checkbox" name="car" value="opel">Opel<br>
<input type="submit" value="Submit">
</form>
The FORM will need an ACTION to say what CGI script to POST to.
 
Old 06-28-2013, 10:08 AM   #6
litzel
Member
 
Registered: May 2013
Location: Athens, Greece
Distribution: Xubuntu 12.04, Linux Mint 13
Posts: 80

Rep: Reputation: 5
The Submit button is that action
 
Old 06-28-2013, 11:27 AM   #7
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
http://www.w3schools.com/tags/att_form_method.asp


<form action="demo_form.asp" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
 
Old 07-07-2013, 10:37 AM   #8
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by linosaurusroot View Post
http://www.w3schools.com/tags/att_form_method.asp


<form action="demo_form.asp" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
thx reply ,

I really not know how to do it , what is the program demo_form.asp ? what I would like to do is if the user select volvo , then run script 1 , if the user select saab , then run script 2 , can advise what can I do ? could please advise the rest of the program ?
thanks a lot
 
Old 07-07-2013, 11:34 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,632

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ust View Post
thx reply ,

I really not know how to do it , what is the program demo_form.asp? what I would like to do is if the user select volvo , then run script 1 , if the user select saab , then run script 2 , can advise what can I do ? could please advise the rest of the program ?
thanks a lot
As you've been asked SEVERAL times before, you need to spell out your words.

And the demo_form.asp file is a SAMPLE name that was on the tutorial website. It was given to you so you could learn how to do it yourself. We are NOT going to write code for you. You've been given the answer and a how-to guide...now it's up to you to actually do it. And as has been pointed out before...you have been here for TEN YEARS NOW. At some point, you should be able to write your own scripts and look things up for yourself. To give that a little bit of perspective, ten years is enough time to:
  • Start and finish high school
  • Start and finish college
  • Get a masters degree
There are many, MANY easily-found examples on how to do what you want, in JSP, ASP, HTML, PHP, etc., that Google can point you to. If you're not a programmer and not familiar with this, then perhaps hiring a consultant would be best, if you don't want to learn how to do it yourself.

Last edited by TB0ne; 07-07-2013 at 11:36 AM.
 
Old 07-08-2013, 09:01 AM   #10
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Try this.
http://www.webdevelopersnotes.com/ti...io_button.php3
 
1 members found this post helpful.
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to read path from console and used to change the script execution path vdamgo Linux - General 5 02-12-2013 02:18 PM
where to get linux administrator script, ex: script to let's user change user info. hocheetiong Linux - Server 1 03-17-2008 12:06 AM
Change batch script to shell script alan.belizario Programming 5 03-31-2005 12:41 AM
Change batch script to shell script alan.belizario Linux - Software 1 03-30-2005 01:49 AM
Password Change Script krpotdar Linux - General 6 04-17-2002 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration