+ 1
Fixing this code
So I have this code. There are specific things I want to happen, but don't know how to make them happen. For instance, I want the submit button to always say "submit" regardless of the previous input value. And the button should always say "Click Me" I guess what I'm saying is I want each input to ignore the value of the previous input. So when I set a date for the date input, then switch to the button, The button should say "Click Me" rather than the date from the previous input. https://code.sololearn.com/WZMmxqy8BKtj/?ref=app
9 Antworten
+ 1
Well you can add an if statement in your Attr() function:
if (attribute == "button") elem.value = "Click me";
then keep doing this for all the specific input types
+ 1
Intermediate solution: i.e. deleting previous selection.
https://code.sololearn.com/WzbA62cH8x7y/?ref=app
Not sure I can finish it until the morning at least, sorry.
Edit: Daniel Cooper updated code. I don’t seem to be able to use the ‘color’ option on iOS, so I don’t know how that works, but the rest seems to be working for me. Hope this is what you need.
+ 1
Daniel Cooper
You need associated array to keep track all the options texts.
eg. sel["button"] = "button text";
sel["number"] = "12345";
and ect..
+ 1
Codes calculates all section, can't do partially.
Here the codes
https://code.sololearn.com/W37weENunVkx/?ref=app
0
I tried that but it didn't seem to work. Maybe I misspelled something.
0
I can't get it to work. Nothing is misspelled
halp :(
0
For the submit button you can add value="Submit" to the button.
0
Russ That doesn't work. I chose the color option, then chose the button option, the value from the color option remained.
I'll have to experiment.
0
Can I have an example? (You can just do one)
I learn better by seeing the code