| |

VerySource

 Forgot password?
 Register
Search
View: 2758|Reply: 16

The drop-down menu pops up a new page question, experts please come in.

[Copy link]

1

Threads

7

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-10-21 15:00:02
| Show all posts |Read mode
My drop-down menu is as follows: (select one and a new page pops up)
<select name="select" onChange="javascript:window.open(this.options[this.selectedIndex].value;">
<option value="#" selected>Please select operation</option>
<option value="view-gj-action.do?id=<%=gj.getId()%>">View details</option>
<option value="modify-gj-action.do?id=<%=gj.getId()%>">Modify information</option>
<option value="add-gj-file-action.do?id=<%=gj.getId()%>">Add drawing</option>
</select>
Can it be like this: a new page pops up when you select "Add Drawing", but does not pop up when you select "View Details" and "Modify Information".
Please expert help, thanks in advance.
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-10-21 15:15:01
| Show all posts
This is ok. Check if your url is correct. You can replace <%=gj.getId()%> with a specific Id and try again to see if it can pass
Reply

Use magic Report

0

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-10-21 15:30:02
| Show all posts
Call JS in the ONCHANGE event, and call form1.submit() in JS.
Reply

Use magic Report

1

Threads

7

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-10-21 16:15:01
| Show all posts
Pleaseqiqituoto remind me again, thank you.
Reply

Use magic Report

0

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-10-21 16:30:02
| Show all posts
Pleaseqiqituoto remind me again, thank you.
////////////////////////////////////////////////// //
I think this big brother means this, that is, let you write a function yourself, judge it and submit your Action
Reply

Use magic Report

1

Threads

7

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-10-21 17:15:01
| Show all posts
I am not familiar with javascript, pleaseqiqituofor advice. Thank you!
Reply

Use magic Report

1

Threads

7

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-10-21 17:30:01
| Show all posts
What I mean is that there is a choice to pop up a new page. When you select "Add drawing", a new page will pop up, and when you select "View details" and "Modify information", it will be displayed on this page. Please advise me, thank you!
Reply

Use magic Report

0

Threads

16

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-10-21 18:00:01
| Show all posts
Haha the easiest way
<option value="view-gj-action.do?id=<%=gj.getId()%>"><a href="...">View details</a></option>
Reply

Use magic Report

1

Threads

7

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-10-21 18:15:01
| Show all posts
<option value="view-gj-action.do?id=<%=gj.getId()%>"><a href="...">View details</a></option>
-------------------------------------------
Brother, this can't work, I tried it and couldn't.
Reply

Use magic Report

0

Threads

16

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-10-21 18:30:01
| Show all posts
Haha it's like this
<select name="select" onChange="if(this.value==1){location.href='view-gj-action.do?id=<%=gj.getId()%>';}if( this.value==2){location.href='modify-gj-action.do?id=<%=gj.getId()%>';}if(this.value=3){window.open(' add-gj-file-action.do?id=<%=gj.getId()%>');}">
<option value="#" selected>Please select operation</option>
<option value=1>View details</option>
<option value=2>Modify information</option>
<option value=3>Add drawing</option>
</select>
location.href is opened on this page
window.open is the new window
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list