Help - Search - Members - Calendar
Full Version: HTML form entry done broke
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
librarianlauren
Hello,

I'm taking a class on web forms right now, but haven't gotten to the part where I can fix this. This part of the website is old markup (taken from a much older version of the website) and is supposed to allow the user to enter the name of a journal and then take them the results page. It doesn't do that. It just acts as a link.

Go ahead and take a look at http://library.shoreline.edu/home/

click the "Journals" tab in the box marked "Search Explore Discover"

http://imgur.com/drgXfP6

If you have the time and the patience to teach a librarian how the heck all this stuff is supposed to equal a web form, I'd be grateful. Thanks!
pandy
I don't know. There should be a script (or several) and a database involved. We can't see those parts. sad.gif
Christian J
QUOTE(librarianlauren @ Feb 16 2017, 03:27 AM) *

Go ahead and take a look at http://library.shoreline.edu/home/

click the "Journals" tab in the box marked "Search Explore Discover"

That part worked in my browser when javascript is enabled. But when I submit the form I'm taken to another search form at exlibrisgroup.com. Then I need to search there yet again in order to see results.
pandy
Ah, it uses the database at another site. I never looked. I did now, and the form has two action attributes. That doesn't help. Alas neither seems to work. It has two method attributes to, but that doesn't hurt anything.

HTML
<form action="http://wactc-sfx.hosted.exlibrisgroup.com/shoreline/az?lang=eng/" method="get" name="SS_EJPSearchForm" class="navbar-form navbar-left" action="http://library.shoreline.com/srch.php" method="GET">


When I try to submit the form to http://library.shoreline.com/srch.php my browser tells me "This webpage has a redirect loop" and this is what I see in the addressbar... wacko.gif

CODE
http://www.www.www.www.www.www.www.www.www.www.
www.www.www.www.www.www.www.www.www.www.www.www.
www.www.www.www.www.www.www.www.www.www.www.www.
www.www.www.www.www.www.www.www.
library.shoreline.com/srch.php?C=The&N=100&V=1.0&L=cf9fj9lw6m&S=AC_T_B]
http://www.www.www.www.www.www.www.www.www...6m&S=AC_T_B

(I added the linebreaks to avoid a very long line)

Clicking the link above will give the same result.

Maybe your page used to use the script at library.shorline.com and now they've changed things?
pandy
Uh, no. They didn't change things, they ceased to exist.
http://www.shorline.com/
librarianlauren
Thanks for taking a look, guys. Yes, Christian J., it looks like you're seeing my problem. It lets me enter a term, but the term doesn't show up on the next page.

Pandy, I've changed the URL which should have been library.shoreline.edu not .com, but it seems to be acting the same. I'm going to paste the part that isn't working well here. The database it queries is just the one mentioned in the markup at http://wactc-sfx.hosted.exlibrisgroup.com/...ne/az?lang=eng/


<div role="tabpanel" class="tab-pane " id="journals" aria-labelledby="journalstab">

<div class="leslieKnope">
<form action="http://wactc-sfx.hosted.exlibrisgroup.com/shoreline/az?lang=eng/" method="get" name="SS_EJPSearchForm" class="navbar-form navbar-left" action="http://library.shoreline.edu/srch.php" method="GET">
<div class="form-group">
<input id="SS_CFocusTag" name="C" class="form-control dropdown1" placeholder="" size="12">
<input value="100" name="N" type="hidden">
<input value="1.0" name="V" type="hidden">
<input name="L" value="cf9fj9lw6m" type="hidden">
<select name="S">
<option value="AC_T_B" selected="selected">Title begins with</option>
<option value="AC_T_M">Title equals</option>
<option value="T_W_A">Title contains all words</option>
<option value="I_M">ISSN equals</option>
</select>
<button type="submit" class="btn btn-default">Search</button>
</form>
</div>
pandy
Oh, it was your own domain! I didn't notice. Anyhow, you can't have two action attributes. I sense it's the first one you want, so remove the shorline one.

The values of the name and value attributes you use must be the same as the ones the library site form uses. The text field at their site uses name="param_pattern_value" and yours use name="C". Change that and you'll have better luck.

Also, at the library site the only options are "Starts with" and "Contains", whereas you have 4 options. Two of them are no longer in use and you should remove them. You also need to change the values of the two you keep and the name of the SELECT. View source at the library page and check the current name and values for the radio buttons. They are not the same as you use but they are what you want to use.

Your form will work fine after you have fixed these things. smile.gif
pandy
Actually, only one of your options is still valid. "Title contains all words" has changed to "Contains", so you should change that too.
pandy
If you don't know, the whole trick with forms is coupling name and value pairs. That's what you see in the query string in the URL when you have submitted the form. You see the same thing if you look at your browser's address bar here at the forum. The URL followed by a questionmark and a string of name-value pairs linked together with ampersands.

CODE
...?name1=value1&name2=value2&name3=value3...


The value can be given in the value attribute or typed in a field by the user.
pandy
How does it go?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.