| |

VerySource

 Forgot password?
 Register
Search
Author: hope1226

Collect JS dynamically generated textbox

[Copy link]

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-17 10:27:01
| Show all posts
string [] autotext = Request.Form ["autotext"]. Split (',');

This autotext [0] is equal to "1", autotext [1] is equal to "2", autotext [2] is equal to "3"
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-17 11:45:01
| Show all posts
Don't know what to say. . .
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-1-19 14:09:01
| Show all posts
But
My JS code is this var nums = 0;
var numss = 0;
function addquestions ()
  {
    nums + = 1;
numss = nums;
document.getElementById ("questionform"). innerHTML + = "<div id =\" question "+ numss +"\"class =\" questioncss\"> <br /> Question:&nbsp;&nbsp;&nbsp;&nbsp; <input id =\"" + numss + "\" name =\"questiontext\" style =\"position: relative\" type =\"text\" size =\"50\" />&nbsp; <input name =\"addanswerdell\" type =\"button\" value =\"Add answer\" style =\"position: relative\" onclick =\"addanswers (" + numss + ")\" /> <input id =\"Radio1\" checked =\"checked\" name =\"checktype" + numss + "\" style =\"position: relative\" type =\"radio\" /> Radio <input id =\"Radio2\" name =\"checktype" + numss + "\" style =\" position: relative\"type =\" radio\"/> Multiple choices <br /> Answer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name =\" answertext\"id =\" addanswerid "+ numss + style =\"position: relative\" type =\"text\" /> </ div> <br /> ";
   }
    function addanswers (o)
  {var addid = "question" + o;
Ranch
    document.getElementById (addid) .insertAdjacentHTML ("beforeEnd", '<br> Answer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name =\"answertext\" style =\"position: = 1uouo" text\"/> ');
  }
Is one question to bring many questions
How to enter the database
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-1-19 14:27:01
| Show all posts
And the submitted question should have the ID of the question so that it can be entered into the database
How to do it
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