Select specific input with multiple ID to parse as form
Hello fellow developers
I am student developing a hybrid mobile app using cordova for a school project and I encountered an issue which i need assistance with.
Background info about my dead-end.
- I am trying to display 15 images from my server to the interface for user to select
- I successfully displayed the image with unique value and unique id using the input tag. The outcome is (input id='1' value='1') (It will increment based on the number of images found on my server).
This is where i hit a dead knot... I realised that jQuery selector can only focus on one ID and value $(#ID).val() But what I am trying to achieve here is user select the image input and the appropriate ID is recorded to be parse via an AJAX call to my server and recorded to the DB.
function showAvatarResult(arr) {
//if i is less than the total number of artefacts, increment by 1
for (i = 0; i < arr.length; i++) {
var avatarimage;
var avatarid;
avatarid = arr[i].avatarid;
avatarimage = "<input type='image' id='" + avatarid +"' value='" + avatarid +"' src='" + serverURL() + "/images/avatars/" + arr[i].image + "' width=17%' height='17%' />";
$("#avatar").append(avatarimage);
}
}
<form name="RegisterForm1" id="RegisterForm1">
<center>
<div id="avatar"></div>
</center>
</form>
function registerGroup() {
username = $("#newusername").val();
password = $("#newpassword").val();
email = $("#emailaddress").val();
school = $("#school").val();
contactdetails = $("#contactdetails").val();
groupname = $("#newgroupname").val();
member1 = $("#member1").val();
member2 = $("#member2").val();
member3 = $("#member3").val();
member4 = $("#member4").val();
member5 = $("#member5").val();
member6 = $("#member6").val();
member7 = $("#member7").val();
member8 = $("#member8").val();
avatarid = //stuck here
url = serverURL() + "/register.php";
var JSONObject = {
"username": username,
"password": password,
"email": email,
"school": school,
"phone": contactdetails,
"groupname": groupname,
"leader": member1,
"member2": member2,
"member3": member3,
"member4": member4,
"member5": member5,
"member6": member6,
"member7": member7,
"member8": member8,
"avatarid": //this is where I am stuck
};
$.ajax({
url: url,
type: 'GET',
data: JSONObject,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (arr) {
_getRegisterGroupResult(arr);
}, error: function () {
validationMsg();
}
});
}
javascript jquery cordova hybrid-mobile-app
add a comment |
Hello fellow developers
I am student developing a hybrid mobile app using cordova for a school project and I encountered an issue which i need assistance with.
Background info about my dead-end.
- I am trying to display 15 images from my server to the interface for user to select
- I successfully displayed the image with unique value and unique id using the input tag. The outcome is (input id='1' value='1') (It will increment based on the number of images found on my server).
This is where i hit a dead knot... I realised that jQuery selector can only focus on one ID and value $(#ID).val() But what I am trying to achieve here is user select the image input and the appropriate ID is recorded to be parse via an AJAX call to my server and recorded to the DB.
function showAvatarResult(arr) {
//if i is less than the total number of artefacts, increment by 1
for (i = 0; i < arr.length; i++) {
var avatarimage;
var avatarid;
avatarid = arr[i].avatarid;
avatarimage = "<input type='image' id='" + avatarid +"' value='" + avatarid +"' src='" + serverURL() + "/images/avatars/" + arr[i].image + "' width=17%' height='17%' />";
$("#avatar").append(avatarimage);
}
}
<form name="RegisterForm1" id="RegisterForm1">
<center>
<div id="avatar"></div>
</center>
</form>
function registerGroup() {
username = $("#newusername").val();
password = $("#newpassword").val();
email = $("#emailaddress").val();
school = $("#school").val();
contactdetails = $("#contactdetails").val();
groupname = $("#newgroupname").val();
member1 = $("#member1").val();
member2 = $("#member2").val();
member3 = $("#member3").val();
member4 = $("#member4").val();
member5 = $("#member5").val();
member6 = $("#member6").val();
member7 = $("#member7").val();
member8 = $("#member8").val();
avatarid = //stuck here
url = serverURL() + "/register.php";
var JSONObject = {
"username": username,
"password": password,
"email": email,
"school": school,
"phone": contactdetails,
"groupname": groupname,
"leader": member1,
"member2": member2,
"member3": member3,
"member4": member4,
"member5": member5,
"member6": member6,
"member7": member7,
"member8": member8,
"avatarid": //this is where I am stuck
};
$.ajax({
url: url,
type: 'GET',
data: JSONObject,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (arr) {
_getRegisterGroupResult(arr);
}, error: function () {
validationMsg();
}
});
}
javascript jquery cordova hybrid-mobile-app
"I realised that jQuery selector can only focus on one ID" - Yes, that's the point of selecting elements by id, you can select multiple ids separated by a comma ("#id_1, #id_2"
), please edit the post and include a valid Minimal, Complete, and Verifiable example
– Alon Eitan
Nov 14 '18 at 19:06
jQuery Learning Center
– Andreas
Nov 14 '18 at 19:06
@AlonEitan Hi I am sorry was editing the post with the code snippet
– Infinite_Dots
Nov 14 '18 at 19:12
@Infinite_Dots NP. Why can't you select the elements by some specific class name and then iterate over the elements to create the data?
– Alon Eitan
Nov 14 '18 at 19:15
add a comment |
Hello fellow developers
I am student developing a hybrid mobile app using cordova for a school project and I encountered an issue which i need assistance with.
Background info about my dead-end.
- I am trying to display 15 images from my server to the interface for user to select
- I successfully displayed the image with unique value and unique id using the input tag. The outcome is (input id='1' value='1') (It will increment based on the number of images found on my server).
This is where i hit a dead knot... I realised that jQuery selector can only focus on one ID and value $(#ID).val() But what I am trying to achieve here is user select the image input and the appropriate ID is recorded to be parse via an AJAX call to my server and recorded to the DB.
function showAvatarResult(arr) {
//if i is less than the total number of artefacts, increment by 1
for (i = 0; i < arr.length; i++) {
var avatarimage;
var avatarid;
avatarid = arr[i].avatarid;
avatarimage = "<input type='image' id='" + avatarid +"' value='" + avatarid +"' src='" + serverURL() + "/images/avatars/" + arr[i].image + "' width=17%' height='17%' />";
$("#avatar").append(avatarimage);
}
}
<form name="RegisterForm1" id="RegisterForm1">
<center>
<div id="avatar"></div>
</center>
</form>
function registerGroup() {
username = $("#newusername").val();
password = $("#newpassword").val();
email = $("#emailaddress").val();
school = $("#school").val();
contactdetails = $("#contactdetails").val();
groupname = $("#newgroupname").val();
member1 = $("#member1").val();
member2 = $("#member2").val();
member3 = $("#member3").val();
member4 = $("#member4").val();
member5 = $("#member5").val();
member6 = $("#member6").val();
member7 = $("#member7").val();
member8 = $("#member8").val();
avatarid = //stuck here
url = serverURL() + "/register.php";
var JSONObject = {
"username": username,
"password": password,
"email": email,
"school": school,
"phone": contactdetails,
"groupname": groupname,
"leader": member1,
"member2": member2,
"member3": member3,
"member4": member4,
"member5": member5,
"member6": member6,
"member7": member7,
"member8": member8,
"avatarid": //this is where I am stuck
};
$.ajax({
url: url,
type: 'GET',
data: JSONObject,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (arr) {
_getRegisterGroupResult(arr);
}, error: function () {
validationMsg();
}
});
}
javascript jquery cordova hybrid-mobile-app
Hello fellow developers
I am student developing a hybrid mobile app using cordova for a school project and I encountered an issue which i need assistance with.
Background info about my dead-end.
- I am trying to display 15 images from my server to the interface for user to select
- I successfully displayed the image with unique value and unique id using the input tag. The outcome is (input id='1' value='1') (It will increment based on the number of images found on my server).
This is where i hit a dead knot... I realised that jQuery selector can only focus on one ID and value $(#ID).val() But what I am trying to achieve here is user select the image input and the appropriate ID is recorded to be parse via an AJAX call to my server and recorded to the DB.
function showAvatarResult(arr) {
//if i is less than the total number of artefacts, increment by 1
for (i = 0; i < arr.length; i++) {
var avatarimage;
var avatarid;
avatarid = arr[i].avatarid;
avatarimage = "<input type='image' id='" + avatarid +"' value='" + avatarid +"' src='" + serverURL() + "/images/avatars/" + arr[i].image + "' width=17%' height='17%' />";
$("#avatar").append(avatarimage);
}
}
<form name="RegisterForm1" id="RegisterForm1">
<center>
<div id="avatar"></div>
</center>
</form>
function registerGroup() {
username = $("#newusername").val();
password = $("#newpassword").val();
email = $("#emailaddress").val();
school = $("#school").val();
contactdetails = $("#contactdetails").val();
groupname = $("#newgroupname").val();
member1 = $("#member1").val();
member2 = $("#member2").val();
member3 = $("#member3").val();
member4 = $("#member4").val();
member5 = $("#member5").val();
member6 = $("#member6").val();
member7 = $("#member7").val();
member8 = $("#member8").val();
avatarid = //stuck here
url = serverURL() + "/register.php";
var JSONObject = {
"username": username,
"password": password,
"email": email,
"school": school,
"phone": contactdetails,
"groupname": groupname,
"leader": member1,
"member2": member2,
"member3": member3,
"member4": member4,
"member5": member5,
"member6": member6,
"member7": member7,
"member8": member8,
"avatarid": //this is where I am stuck
};
$.ajax({
url: url,
type: 'GET',
data: JSONObject,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (arr) {
_getRegisterGroupResult(arr);
}, error: function () {
validationMsg();
}
});
}
function showAvatarResult(arr) {
//if i is less than the total number of artefacts, increment by 1
for (i = 0; i < arr.length; i++) {
var avatarimage;
var avatarid;
avatarid = arr[i].avatarid;
avatarimage = "<input type='image' id='" + avatarid +"' value='" + avatarid +"' src='" + serverURL() + "/images/avatars/" + arr[i].image + "' width=17%' height='17%' />";
$("#avatar").append(avatarimage);
}
}
<form name="RegisterForm1" id="RegisterForm1">
<center>
<div id="avatar"></div>
</center>
</form>
function showAvatarResult(arr) {
//if i is less than the total number of artefacts, increment by 1
for (i = 0; i < arr.length; i++) {
var avatarimage;
var avatarid;
avatarid = arr[i].avatarid;
avatarimage = "<input type='image' id='" + avatarid +"' value='" + avatarid +"' src='" + serverURL() + "/images/avatars/" + arr[i].image + "' width=17%' height='17%' />";
$("#avatar").append(avatarimage);
}
}
<form name="RegisterForm1" id="RegisterForm1">
<center>
<div id="avatar"></div>
</center>
</form>
function registerGroup() {
username = $("#newusername").val();
password = $("#newpassword").val();
email = $("#emailaddress").val();
school = $("#school").val();
contactdetails = $("#contactdetails").val();
groupname = $("#newgroupname").val();
member1 = $("#member1").val();
member2 = $("#member2").val();
member3 = $("#member3").val();
member4 = $("#member4").val();
member5 = $("#member5").val();
member6 = $("#member6").val();
member7 = $("#member7").val();
member8 = $("#member8").val();
avatarid = //stuck here
url = serverURL() + "/register.php";
var JSONObject = {
"username": username,
"password": password,
"email": email,
"school": school,
"phone": contactdetails,
"groupname": groupname,
"leader": member1,
"member2": member2,
"member3": member3,
"member4": member4,
"member5": member5,
"member6": member6,
"member7": member7,
"member8": member8,
"avatarid": //this is where I am stuck
};
$.ajax({
url: url,
type: 'GET',
data: JSONObject,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (arr) {
_getRegisterGroupResult(arr);
}, error: function () {
validationMsg();
}
});
}
function registerGroup() {
username = $("#newusername").val();
password = $("#newpassword").val();
email = $("#emailaddress").val();
school = $("#school").val();
contactdetails = $("#contactdetails").val();
groupname = $("#newgroupname").val();
member1 = $("#member1").val();
member2 = $("#member2").val();
member3 = $("#member3").val();
member4 = $("#member4").val();
member5 = $("#member5").val();
member6 = $("#member6").val();
member7 = $("#member7").val();
member8 = $("#member8").val();
avatarid = //stuck here
url = serverURL() + "/register.php";
var JSONObject = {
"username": username,
"password": password,
"email": email,
"school": school,
"phone": contactdetails,
"groupname": groupname,
"leader": member1,
"member2": member2,
"member3": member3,
"member4": member4,
"member5": member5,
"member6": member6,
"member7": member7,
"member8": member8,
"avatarid": //this is where I am stuck
};
$.ajax({
url: url,
type: 'GET',
data: JSONObject,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (arr) {
_getRegisterGroupResult(arr);
}, error: function () {
validationMsg();
}
});
}
javascript jquery cordova hybrid-mobile-app
javascript jquery cordova hybrid-mobile-app
edited Nov 14 '18 at 19:11
Alon Eitan
11.2k63852
11.2k63852
asked Nov 14 '18 at 19:04
Infinite_DotsInfinite_Dots
85
85
"I realised that jQuery selector can only focus on one ID" - Yes, that's the point of selecting elements by id, you can select multiple ids separated by a comma ("#id_1, #id_2"
), please edit the post and include a valid Minimal, Complete, and Verifiable example
– Alon Eitan
Nov 14 '18 at 19:06
jQuery Learning Center
– Andreas
Nov 14 '18 at 19:06
@AlonEitan Hi I am sorry was editing the post with the code snippet
– Infinite_Dots
Nov 14 '18 at 19:12
@Infinite_Dots NP. Why can't you select the elements by some specific class name and then iterate over the elements to create the data?
– Alon Eitan
Nov 14 '18 at 19:15
add a comment |
"I realised that jQuery selector can only focus on one ID" - Yes, that's the point of selecting elements by id, you can select multiple ids separated by a comma ("#id_1, #id_2"
), please edit the post and include a valid Minimal, Complete, and Verifiable example
– Alon Eitan
Nov 14 '18 at 19:06
jQuery Learning Center
– Andreas
Nov 14 '18 at 19:06
@AlonEitan Hi I am sorry was editing the post with the code snippet
– Infinite_Dots
Nov 14 '18 at 19:12
@Infinite_Dots NP. Why can't you select the elements by some specific class name and then iterate over the elements to create the data?
– Alon Eitan
Nov 14 '18 at 19:15
"I realised that jQuery selector can only focus on one ID" - Yes, that's the point of selecting elements by id, you can select multiple ids separated by a comma (
"#id_1, #id_2"
), please edit the post and include a valid Minimal, Complete, and Verifiable example– Alon Eitan
Nov 14 '18 at 19:06
"I realised that jQuery selector can only focus on one ID" - Yes, that's the point of selecting elements by id, you can select multiple ids separated by a comma (
"#id_1, #id_2"
), please edit the post and include a valid Minimal, Complete, and Verifiable example– Alon Eitan
Nov 14 '18 at 19:06
jQuery Learning Center
– Andreas
Nov 14 '18 at 19:06
jQuery Learning Center
– Andreas
Nov 14 '18 at 19:06
@AlonEitan Hi I am sorry was editing the post with the code snippet
– Infinite_Dots
Nov 14 '18 at 19:12
@AlonEitan Hi I am sorry was editing the post with the code snippet
– Infinite_Dots
Nov 14 '18 at 19:12
@Infinite_Dots NP. Why can't you select the elements by some specific class name and then iterate over the elements to create the data?
– Alon Eitan
Nov 14 '18 at 19:15
@Infinite_Dots NP. Why can't you select the elements by some specific class name and then iterate over the elements to create the data?
– Alon Eitan
Nov 14 '18 at 19:15
add a comment |
1 Answer
1
active
oldest
votes
You should add a class to each image input like <input class='image-input' type='image' id=...
(this should be the same class name on all image inputs) and then use the following script to set a variable equal to the input's ID when clicked:
<script>
var selectedImageId;
$('.image-input').click(function(){
selectedImageId = $(this).attr('id');
});
</script>
Then, in your registerGroup()
function, access the variable like this:
...
member8 = $("#member8").val();
avatarid = selectedImageId;
url = serverURL() + "/register.php";
...
...
"member8": member8,
"avatarid": avatarid
};
...
I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request.
2
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53307115%2fselect-specific-input-with-multiple-id-to-parse-as-form%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should add a class to each image input like <input class='image-input' type='image' id=...
(this should be the same class name on all image inputs) and then use the following script to set a variable equal to the input's ID when clicked:
<script>
var selectedImageId;
$('.image-input').click(function(){
selectedImageId = $(this).attr('id');
});
</script>
Then, in your registerGroup()
function, access the variable like this:
...
member8 = $("#member8").val();
avatarid = selectedImageId;
url = serverURL() + "/register.php";
...
...
"member8": member8,
"avatarid": avatarid
};
...
I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request.
2
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
add a comment |
You should add a class to each image input like <input class='image-input' type='image' id=...
(this should be the same class name on all image inputs) and then use the following script to set a variable equal to the input's ID when clicked:
<script>
var selectedImageId;
$('.image-input').click(function(){
selectedImageId = $(this).attr('id');
});
</script>
Then, in your registerGroup()
function, access the variable like this:
...
member8 = $("#member8").val();
avatarid = selectedImageId;
url = serverURL() + "/register.php";
...
...
"member8": member8,
"avatarid": avatarid
};
...
I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request.
2
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
add a comment |
You should add a class to each image input like <input class='image-input' type='image' id=...
(this should be the same class name on all image inputs) and then use the following script to set a variable equal to the input's ID when clicked:
<script>
var selectedImageId;
$('.image-input').click(function(){
selectedImageId = $(this).attr('id');
});
</script>
Then, in your registerGroup()
function, access the variable like this:
...
member8 = $("#member8").val();
avatarid = selectedImageId;
url = serverURL() + "/register.php";
...
...
"member8": member8,
"avatarid": avatarid
};
...
I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request.
You should add a class to each image input like <input class='image-input' type='image' id=...
(this should be the same class name on all image inputs) and then use the following script to set a variable equal to the input's ID when clicked:
<script>
var selectedImageId;
$('.image-input').click(function(){
selectedImageId = $(this).attr('id');
});
</script>
Then, in your registerGroup()
function, access the variable like this:
...
member8 = $("#member8").val();
avatarid = selectedImageId;
url = serverURL() + "/register.php";
...
...
"member8": member8,
"avatarid": avatarid
};
...
I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request.
edited Nov 14 '18 at 19:55
answered Nov 14 '18 at 19:41
Justin T.Justin T.
597313
597313
2
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
add a comment |
2
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
2
2
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
"I would do some input validation to ensure you have valid inputs before you send the data in the AJAX request." -- I hope you also validate on the server. Validating on the client is to assist the user and to avoid wasting a round-trip when the client knows the data is not valid, but ... The Server must not trust what the client sends it.
– Stephen P
Nov 14 '18 at 20:05
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53307115%2fselect-specific-input-with-multiple-id-to-parse-as-form%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
"I realised that jQuery selector can only focus on one ID" - Yes, that's the point of selecting elements by id, you can select multiple ids separated by a comma (
"#id_1, #id_2"
), please edit the post and include a valid Minimal, Complete, and Verifiable example– Alon Eitan
Nov 14 '18 at 19:06
jQuery Learning Center
– Andreas
Nov 14 '18 at 19:06
@AlonEitan Hi I am sorry was editing the post with the code snippet
– Infinite_Dots
Nov 14 '18 at 19:12
@Infinite_Dots NP. Why can't you select the elements by some specific class name and then iterate over the elements to create the data?
– Alon Eitan
Nov 14 '18 at 19:15