ameliabob Posted March 24, 2011 Share Posted March 24, 2011 I am trying to have an 'href' that can be modified before it is executedin my code I have a line:<a href="process.php?function=UpdateDataBase" >Update Database</a>This works just fine.I would like to have a text box in the window that I could type a date and then have the href look like<a href="process.php?function=UpdateDataBase&NewDate=03/11/2011" >Update Database</a>I tried putting some javascript code to append the red code; but the <a href wouldn't allow me to imbed the field label.Is there a clever way to do this? Link to comment Share on other sites More sharing options...
thescientist Posted March 24, 2011 Share Posted March 24, 2011 what is your javascript code?basically it should 1) get the value of the input field (value, not html)2) get the value of the href attribute of the <a> tag3) concatenate the two using appropriate delimiters, i.e. &4) take that concatenation and reassign it back to the href attribute of the <a> tag Link to comment Share on other sites More sharing options...
ameliabob Posted March 24, 2011 Author Share Posted March 24, 2011 Its point 4 that I am having the trouble with. Link to comment Share on other sites More sharing options...
thescientist Posted March 24, 2011 Share Posted March 24, 2011 what is your javascript code? Link to comment Share on other sites More sharing options...
ameliabob Posted March 25, 2011 Author Share Posted March 25, 2011 Thanks Mr. Scientist,Your questions got me on the right track to find what I needed to do. I didn't know about the attributes associated with the tags and the getelementByID. It is now working like I had envisioned.Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.